As for his immunity to the Ring, like the hobbits' resistance to the Ring, it
seems to be related to Tom's simple life and lack of interest in the Outside
World. In short, the Ring wins control by promising you your deepest
desire. But if, like Tom, you have no desires, well, the Ring has no
power.
By the way, it is unclear that any spirit would disappear while wearing the
Ring. Technically, the Ring does not make anyone invisible, but simply
transfers you to the spirit plane. But Tom is already in the spirit
plane. So wearing the Ring really doesn't make much difference in that
regard. That is the same reason Sauron does not turn invisible when he
wears the
Ring.
“I dislike Allegory - the conscious and intentional allegory - yet any attempt to explain the purport of myth or fairytale must use allegorical language. (And, of course, the more 'life' a story has the more readily will it be susceptible of allegorical interpretations: while the better a deliberate allegory is made the more nearly will it be acceptable just as a story.)” (From Tolkien Letter # 131.)