system
Given the following post, respond as if you're commenting on Reddit:
human
[LotR] Ultimately, what was Saruman's motivation? Lust for power? For the Ring? Loyalty to Sauron?
gpt
Despair.

He and the other Wizards were sent to Middle Earth by the gods to defeat Sauron: counter his evil works, set the Free races up into better positions of power, heal his corrupting touch, and basically work against him. For millennia they did so (all five).

However, by the Third Age one of the Two great nations of Numenorian Men had fallen: Arnor, the northern kingdom had shattered into three smaller kingdoms, each much lesser than than the former. Those two, slowly fell under the tide of Darkness. Gondor was diminished due to the loss of Isilidur and no clear heir (yet). The Southrons, Black Numenorians, and Corsairs daily encroached upon Gondor from the South and indeed had taken much of the land that was Gondor's in centuries old. From the East cam Mordor's orcs, time and time again. All of Gondor's fortresses in Mordor had fallen: Durthang, Minas Ithil, the Black Gate.

Rohan was still strong, but Gondor and they had not grown close. Indeed as years passed, their alliance became a memory and seldom did either help the other: though admittedly not from distrust, but rather from lack of ability. Both nations were sorely pressed. Rohan was constantly attacked from goblins from the Misty Mountains along with Trolls and Worgs. Dunlanders, evil men, would also harrow and attack their lands.

The Elves were leaving, every year in greater numbers. Lothlorien was still a Power and a great light in the Darkness, but it was a light on the waning. Dol Gildur was a dark spot that stood strong, and every time Lothlorien threw it down, it would rise again and again. Lothlorien paid a cost each time as well. The Elves of Mirkwood show their weakness in their own name. Once called the Greenwood, it had been corrupted and tainted. Men felled the borders with axes, spawn of Ungoliant had moved into the lands, and orcs roamed free along the south. The land changed, and the Forest Elves retreated to their fastnesses and ignored the world. Those few who left their secure regions only did so to go West, into Valinor.

The Dwarvish Kingdoms were in decline. Once mighty houses and strongholds, one by one they fell to Goblin or Dragon. Trolls made their home in many a dwarfhold. Many tribes were reduced to wanderers and tinkers (as Thorin's people were, before the Quest). They in response dug deeper and shut themselves away from the world of Man and Elf and left the alliances seeking to be left alone.

The East was growing in power, and often sent Men and armies to fight the weakening West. Two Wizards went hence, but were never seen again. Sources differ on if they succeeded in stopping the Darkness from spreading to the Eastern Kingdoms, but the fact that Easterlings continued to serve Sauron gave proof to that answer (although some writings at the tie of the War of ring show uprisings in the East that prevented the great strength of the East from marching on the Western Kingdoms and peoples, so there's hope the Blue Wizards did indeed succeed in their mission).

In the North, the Orcs and monsters of Angmar and Gundabad were closing ever closer to the peoples of the sparsely settled Eridaor (what was left of the fallen three kingdoms and noted mostly for the Shire). There were also wars with the Elves of the Grey Havens and the Dwarves of the Blue Hills against Sauron's forces, nearly unceasingly.

Radagast was too focused on his plants and animals and had basically given up on defeating Sauron. He spent his time healing the land and guiding Elves to the Grey Havens. Gandalf was the weakest of them and spent so much time with the weakest races: hobbits, dwarves, and the lesser men. The Blue Wizards had long since left and no word was sent.

The Ents were asleep and unmotivated to move or react. Many had slept so long as to be nothing more than particularly long lived trees (some ill spirited to be sure).

Tom Bombadil was Tom Bombadil and would remain so even as the Dark surrounded his Garden and killed all his friends. He would not act, care, nor notice, not until the Shadow ruled all. And even then there was question if he would even care.

And Mordor's power grew. Terrible engines of war like Grond and others. Great factories belching fire, smoke, and iron. Powerful men of evil blood with dread and fell magics. The Nazgul and their flying beasts. Sauron's own deceptions of the lesser mannish races of the West. The Shadow that lay upon everything. Sauron was growing in power, daily it seemed. His orc armies were larger than ever and he had been breeding new types of orcs and trolls: bigger, meaner, smarter, and able to resist the Sun and the light.

And all of this was seen by Saruman via the Palantir he held. He watched what it showed him and felt despair. Sauron talked to him, whispered lies and entreaties and showed him the might of Mordor and Sauron. There was a lot he didn't show him, the smaller victories the West was having (The mission to Lonely Mountain and the Death of Smaug, Aragorn burning the Corsair Fleet, whatever the Blue Wizards were doing). Sauron showed what he wanted and slowly twisted Saruman's will. Eventually Saruman made a realization that Man was doomed and Sauron would win. 

His hopelessness drove him to ally with Sauron. Perhaps at first to betray him and save the day in the end, perhaps to supplant him and at least guide the victory of evil towards a better course. But Sauron is corruption personified, as seen i the effects of the Ring. Whatever other reasons Sauron had initially for betraying the gods and the light of Iru Illuvatar, in the end he made a choice to Rule in his own name because he felt despair at the future. He would take the Ring, master it, and then cast down Sauron. Saruman would rule the world and shape it towards a destiny that would strength all. And maybe, in the end, challenge even the one most high.

Saruman saw what the power of Mordor was and lost Hope. He despaired and gave up because there was no chance to win. Any attempt was a fool's mission and only by allying with Sauron could anyone have even a hope of survival.