I believe he is considered the spirit of that world, not necessarily a god, but a physical incarnation of the world. It would explain why he holds an insane amount of power and even Sauron’s ring only tickled him. It also makes sense when Gandalf says if Mordor conquers the rest of the world then maybe bombadil would fall because the world would be irreparably harmed
I never thought of him being immune to Sauron as him being powerful. He is just like the the hobbits but to its fullest. Bombadil is perfectly content with his own existence and there is nothing for the ring to tempt him with.