Tom Bombadil is, of course, an enigmatic character. While his behaviour is fairly straightforward, it is his origin and the extent of his powers that have puzzled generations of Tolkien fans. This of course, only makes him more appealing.
The discussion about Tom Bombadil's origin and purpose comes up repeatedly among readers. One time, someone explained the appeal to me. He said that in the narrative structure of the work, which on the surface seems to be dominated by a battle between "good" and "evil", Bombadil represents nature, wild, neutral position that doesn't "take sides". While this point probably explains much of Bombadil's appeal, especially to the pagan types that make up a large part of Tolkien's hardcore readers, part of its premise is incorrect.
J.R.R. Tolkien was a Christian, a Roman Catholic, and although he never wrote his books as allegory or propaganda, he would never include anything that was philosophically against basic tenents of Catholic theology. Manicheanism, the belief that good and evil are equal, is against Catholic theology, and is clearly not the basis of the mythology or cosmology of Tolkien. As in Christian mythology, the chief evil agent is a fallen angel, the creation of God and not his opposite. Because of this, the existence of evil, whether in the form of Morgoth or Sauron, does not change the essential cosmological order of Ea, but is only a historical factor in it, even if it becomes (apparently) the overarching factor of history.
Bombadil's appearences in the story demonstrates Tolkien's belief that morality is separate from narrative. In other words, someone's moral choices are not defined by what "side" they take, or by taking a side at all, and what final aims they work towards, but by whether they act in a moral, compassionate manner in any individual circumstance. Since the world is not "cosmologically" separated into "good" and "evil", Bombadil is not somehow outside the world of the good people. They exist in the same world as him, they just choose to actively promote their morality in one way and him in another.