Tolkiens work was inspired more by his in-depth knowledge of Norse and Germanic folklore more than his religious beliefs.

Though Tolkein was certainly a religious person, he said himself that his religion had no impact whatsoever on his writing. He said he wanted to create a new mythology for the British Isles, based, I suppose, loosely on the pre-existing legends. The main backbone of his stories was the languages that he created. He was a lingusitics professor, ya know. He also just wanted to create his own little (read vast and complex) world. Don't we all?