The reasoning was roughly:
* Mordor is obviously meant to be USSR, as it's in the east.
* The orcs are clearly heavy industry workers, building the world of future.
* Bilbo is obviously a son from a bourgeoisie family, disgusted by hard work.
* The west is represented by elves = aristocracy, people = bourgeoisie, hobbits = landowners.
* The group of reactionaries are afraid of a made up "threat from the east", led by Gandalf.
* Gandalf = a reactionary ideologue, keeping people in state of fear of progress and knowledge.
* Saruman = protector of the oppressed, declared a traitor and destroyed by the reactionaries.
* But socialism can't be destroyed by throwing something in the fire. All the power to Mordor, surrounded by reactionary neighbors.