This is relevant for some fantasy worlds, but not for Middle Earth.
Morality in Middle Earth is clearly not derived from divine mandates. Magic is relatively rare and not used to support economic activities all that much. It is in fact on its way out by the end of LoTR.
Well, there isn't much of invidual every day morality in LOTR basically. It's more of a morality for kings tale.
who is the most moral character? Gandalf. And he is a mouthpiece from the Valar to men.
Who are the most moral people? The elves. They're closest to the Valar and are always good, to the point you can debate whether they have free will or not.
What's the job of a moral ruler? To fight the beasts of Morgoth and men not from the north west, all the people that never got told morality from the Elves in ancient times.
what's the ultimate sin? to challenge God and the Valar, of course. God will sink your continent to the sea and reshape the planet if you dare.
But… no? I don’t think this is what people generally believe at all. The elves are certainly not the most moral faction.
The morally challenged characters in my opinion are Boromir, Sam, and Pippen.
Almost every main character is clear that they desire to do good. Their struggle is not navigating grey space, but trying to figure out how to overcome barriers to do so (personal, hierarchical, self sacrificial, etc.).
Morality in Middle Earth is clearly not derived from divine mandates. Magic is relatively rare and not used to support economic activities all that much. It is in fact on its way out by the end of LoTR.