Although it has been nearly two decades since the trilogy ended, the The Hobbit series, Amazon has invested $1 billion into a TV show set within the Tolkien universe, showing the potential for success the story has.
Although each character deviates from their preset personality, they are tested throughout the series, each of them inevitably returning to their own in-built moral grounding. The list below identifies the various alignments of some of the main characters in LOTR, based on the system used by Dungeons & Dragons.
Gandalf - Lawful Good (Crusader)
The Grey Wizard is sent to Middle-Earth by the Vala, but only after stripping him of most of his powers (because they do not want a repeat of the last time a.k.a. Sauron.) Gandalf spends centuries stalking the whereabouts of the Necromancer, finding nary a clue because the One Ring is still floating around on some riverbed.
He is a Crusader, due to his inbuilt selflessness, like when he saves the Fellowship from the Balrog. For this sacrifice, he was returned to Middle-Earth with a considerable job promotion: Gandalf The White.
Aragorn - Lawful Good (Crusader)
The leader of the Dúnedain, the heir of Elendil, the lover of Arwen — being all these things, Aragorn can't help but be a Crusader. He doesn't care for wealth or power, nor for the throne of Gondor, but he does accept it when it is thrust upon him. Aragorn is humble, proof of which is shown when he bows to the four Hobbits in honor of their accomplishments.
He is also highly skilled at medicine, a fact that the citizens of Gondor use to confirm that he is indeed their long-lost ruler, saying that "the hands of the King are the hands of a healer, and so shall the rightful King be known."
Frodo Baggins - Neutral Good (Benefactor)
Excluding that uncharacteristic character deviation at the cracks of Mount Doom, Frodo is a genuinely kind, caring, and sympathetic hobbit. He does not question his burden (too much) of bearing the toxic One Ring, understanding the consequences of his inaction.
While Sam helps him carry his weight now and then, Frodo somehow makes it right till the end, all to nullify the possibility of an alternative timeline: horrific visions of the Shire burning.
Gimli & Legolas - Chaotic Good (Rebels)
This pair double-handedly shatters the pervasive enmity that Dwarves and Elves have displayed for each other for countless eons. By the very act of behaving in friendly manner, let alone becoming buddies, Legolas and Gimli are Rebels.
In fact, they don't really seem to do anything that doesn't involve the other, for instance, the kill count game that they good-naturedly play. They are individually Rebels as well: Legolas is a Forest-Elf who heeds the call of the Sea; Gimli is a Dwarf who follows Galadriel to the Undying Lands.
Samwise Gamgee - Lawful Neutral (Judge)
The sweetest person in all of Middle-Earth, and simultaneously the most durable, is Samwise. Unlike Frodo, or even any of the other Fellowship , Sam does not get distracted by anything (except Gollum).
Being a Judge, he is hell-bent on casting the cursed jewelry back into the fiery pits from which it was made; it can be argued that his actions make him one of the most important characters in the entire story. For an inexplicable reason, Sam doesn't react as negatively to the One Ring as the others, but that could be due to his infrequent handling.
Gollum - True Neutral (Undecided)
Gollum is not a villain; nor is he a hero. As Gandalf tells a frustrated Frodo, "Gollum has some part to play in it, for good or evil, before this is over." The poor ex-Hobbit has no choice in his actions, given that the One Ring has eternally bound him to its will.
As a True Neutral, Gollum shows that he cares little for the War: his allegiance lies not towards Sauron nor Middle-Earth, but only towards satiating the gnawing hunger for his precioussss.
Meriadoc Brandybuck & Peregrin Took - Chaotic Neutral (Free Spirits)
Merry and Pippin are rascals to the nth degree. In fact, Pippin is still a child according to Hobbit rules, being only 28 years old. Free Spirits like these two are more interested in deriving pleasure from the situation, irrespective of how annoying it is for others (or how it might affect them.)
For instance, they set off a crate of fireworks at Bilbo's Eleventy-First birthday party, which leaves them at the disciplinarian mercy of Gandalf. In another case, they drink copious quantities of Treebeard's Ent-draught, which allows them to break all historical records in of Hobbit height.
Boromir - Lawful Evil (Dominator)
The only negative role in the Fellowship, Boromir seeks the One Ring to ward off the armies of Sauron that are beginning to muster at the gates of Gondor. Although his reasoning is tainted by a blind faith in his father, Boromir acts like a total Dominator when he assaults Frodo and tries to steal the One Ring.
Luckily, he soon comes to his senses, proving that he fights for the right side when he takes a number of Orcish arrows to the back while shielding the Hobbits.
Sauron - Neutral Evil (Malefactor)
Sauron might have been innocent a hundred millennia ago, when he was an angel serving at Eru's feet. The corruption of Morgoth, however, shackles him eternally to his dark master and his darker ways.
Even though Morgoth is now gone, cast into the Timeless Void, Sauron carries the same heritage forward. His creation of the Rings of Power, the subtle manipulation of Ar-Pharazôn, the gruesome fates he delivers his enemies — all these and more designate him a typical Malefactor.
Saruman - Chaotic Evil (Destroyer)
Saruman, once The White, has been infected with a greed for power. Ruling from Orthanc, he assumes to take control of Middle-Earth by destroying its innocent denizens as well as deposing Sauron.
Unfortunately, his strategies and manpower fail him, as his fortress and armies are ravaged by the Ents. Saruman remains a Destroyer to the very end; in the books, he flees to the Shire, where continues his despotic oppression, albeit on a smaller scale.