Tolkien wrote a world that functions the way a Catholic wants the real world to work, even though it doesn't.
Morality is uncomplicated, there is a clear black and white divide and nobody ever wonders if say, Sauron might be coexisted with in some way.
Morality is deontological. Good actions are good, period. Furthermore, they don't backfire. When Gandalf lets Grima go, or when people take pity on Gollum, that's not naive idealism, that's the objectively right thing to do. Such actions just don't backfire on people in this world.
On the other hand, evil is a path to ruin and misery. Grima is miserable with Saruman, Saruman doesn't like him either. Saruman dies by Grima's hand once Grima has had enough, and Grima dies too. Villains don't get happy endings.
Mercy has a magical power of sorts. Frodo only succeeds because of his mercy on Gollum.
There's also an essentialism to things. Tom Bombadil is this weird thing, and that's that. You can't convince him to take care of the Ring, it's just not in his nature to care about that sort of thing, and it's completely non-negotiable.
Evil never creates, it only spends chunks of itself to corrupt perfection.
If you read it from the standpoint of "what if Catholicism was true, and the world functioned in the way the religion says it does", it's quite interesting.