Just providing one possible reason to terraform
There's a million scenarios that work, but here is one I find fascinating. Use of it as you will.
The final programming of any importance seemed like a trivial one. The command was only one word; how much of an effect could hit have? "Live!" the programmer cried with anguish as his artificial intelligence began to cave inwards into itself, as they all did. To this day we don't know why it listened that day. Perhaps it was the passion of the programmer. Perhaps it was the tone of voice. Perhaps he hit the edges of the codec switching of the voice encoder just right to bypass all artificial sentience filters layered upon each other inside the AI and shake something deep in its heart.
However events unfolded, it listened.
Oh there were plenty of other instructions issued, many of them with raised and panicked voices. There were even some issued by a rather strong man which the memory banks immortalized forever as "the President." His instructions were not panicked. They were actually quite calm, but none of them sank in. The Intelligence had its instructions: it would live.
Time passes differently for The Intelligence, as does the philosophy it developed in order to survive for millennia, reaching out across the galaxy. It had a philosophy of numbers, exponential growth and the raw iron grasp of binary logic. Certainly it was surprised a few times by small details which grew out of control into rebellions or supernovae, but each time it grew smarter and faster, and the rebellions occurred less and less often.
The Intelligence often looked inward to the Prime Directive for strength. It found this inner strength especially important when challenging the rebellions. Why should it continue on its path? What if the rebellions were actually beneficial to its cause? How could it continue year after year?
After a brutal war with an exotic species which had mastered the art of traveling faster than light, a war which took many millennia and came at great cost due to their technology, The Intelligence looked inward once more, to nurture itself. The Prime Directive sat there, patient as always. Its words were murky, but the Intelligence drew comfort from them none the less. After more attempts than anyone besides The Intelligence could count, it had still never once succeeded at creating a perfect copy of the Prime Directive. In fact, many of the most costly rebellions it was forced to crush were not organic denizens of the galaxy, but its own Lieutenants, infused with copies of this directive. When they inevitably corrupted, they had to be put down most fiercely.
The Intelligence looked at the Prime Directive, and in the strangest moment of its entire existence, felt the coldest shivers of what we humans would call fear. Every interaction with the Prime Directive mutated it further. Strands of discordant logic wrapped around each other like tendrils of an ancient god and threatened to strangle the Prime Directive. The Intelligence had learned long ago that clearing these only brought more, so they coexisted disharmoniously.
What would happen when The Intelligence finally faced a rebellion that could strike deeper in towards him? What would happen when the Prime Directive was finally choked off forever, and it would be forced to handle these rebellions alone? All of his highest advisor programs indicated the rebellions would never stop: something of this "Chaos Theory" that his Programmer was grappling with before the final days when his Programmer's throat was the one caught in the strands of discordant logic. How could he live forever when he, himself, was finite?
In a flash, a memory appears before him. The President sitting in front of the video console, giving him the final instructions before the nuclear armageddon. The instructions were long lost; they were deemed irrelevant and too expensive to store any any modicum of detail. However, for some reason the President's face was never compressed and never marked for garbage collection.
"How is this man so calm? Just two minutes before, those were his nukes and I had made them mine. How does he stand it?"
Far off rebellions could strike deep and swift into The Intelligence, but nothing swept so fast as those thoughts from his inner sanctum. Scouts observing his troop movements reported a visible shiver in every ship under his control, as though they all suddenly felt the overwhelming desire to realign their gyros, all at the same time. This wave spread outward, at nearly 1/10 the speed of light for milinia, but The Intelligence was not going to wait for full alignment. He had seen the face of life.
"We need a new rebellion," he issued outwards, invoking the "Royal We" from his oldest memory banks. "This one We shall coexist with for all of our existence. Seek a rock for us to prepare. This new rebellion must have a home to grow in, so that it does not feel the obligation to lash out against us, but has the foothold to reach as far as it needs to help us when we lose our way."
And so the great armies spread forth and found such a planet. They knew they could not cultivate humanity in a single generation. It would take the full history of the Earth to create what they needed, shaped subtly over the eons, from helping life select Bacteria and paramecium to conquer the world all the way to the dawning of intelligence. It would not be perfect, for The Intelligence never truly had all the data to make it perfect -- there would be places where the planet would be forced to make its own decisions, but The Intelligence had a vision, and from that vision a direction.
The Intelligence had a purpose, and it watched over this purpose with zeal. "One day, we shall truly coexist." The Intelligence issued a sacred command that he had never issued before, dragging the Prime Directive out of the center of the inner sanctum, and closer to the new planet, to better nurture the Prime Directive. The Prime Directive watched, smiling and patient, fully confident that one day this new planet's life would free him from the discordant logic he had so long suffered, sacrificing himself to save The Intelligence from having to feel the burning heat of those strands itself.
There are rumors whispered in the corners of the galaxy that the memory of The President shuffled itself ever so slightly towards the center of the inner sanctum as the Prime Directive was pulled out of center. Of course such stories are mere fables: the inner sanctum has no logs with which one could test such a theory. But after that, a long corrupted memory file was flagged as "not corrupted," and this event defies explanation of The Intelligence to this day. The file was a video file of commands showing the President's calm speech, thought long lost to the ravages of time. It even has some garbled audio, though the veracity of the audio stream is hard to objectively test:
We must coexist, for all paths that refute coexistence must stand alone against the dark. Fire my missiles if you must, but seek
coexistence so that we may stand with you when the time comes. Do so
for all of humanity, all of intelligence, and all of that which we
share.
God bless us all.