Tolkien studiously avoided any overtly religious content. In his Middle
Earth works in general (particularly the Silmarillion), he modeled an invented
religion (with a One God, lesser gods, creation myth, etc.), but except for a
few references to Elbereth (one of the Valar, roughly equivalent to Greek gods
but subject to the One God Eru) even that doesn't explicitly appear in
LotR. Moreover, he firmly rejected any attempt to find religious icons
(e.g. Frodo = Jesus) in the books.
However, the moral content permeates everything. Moral people honor their
committments and oaths (even if it means suffering and death) because it's the
right thing to do. When everything is against them, and there is no hope
at all, they press on because they've made a committment and will honor
it. Moral people show pity for the unfortunate, even those of dubious
character like Gollum: the pity shown to Gollum by Bilbo, Frodo, and
(ultimately) Sam ends up saving the world. There are more themes of this sort,
but these are the most important.
Yes, Tolkien was a devout Catholic, and there is no inconsistency between the
morality inherent in LotR (or, for that matter, his invented cosmology) and
Catholic doctrine, but there is no explicit religious content in these
books.