File1265602297.jpg-(644 KB, 1200x1626, techlevels.jpg)
The ship was built for a number of reasons. First, Mechanicus theology. For matter and energy to be dead and unutilised, lying around as rocks and dirt or streaming uselessly into space, is a terrible, terrible waste. It is our duty as sentient beings to harness and shape the available matter and energy into more advanced, useful, and holy forms. The ideal endpoint is for the the mass of the universe to be converted into functioning machinery, at one with the Omnissiah. They can't pull that off yet, but converting the mass of the entire Imperium into a functioning starship is a damn good start.
Second, tactics. The Imperium was simply indefensible, over a million worlds with lightyears of unreliable warplanes between them. The Emperor's Navy, Guard, and Astartes could simply not be everywhere they needed to be. It had gotten to the point where the strategy was simply for PDF to die standing, losing worlds as slowly as possible, so the Guard and Astartes could eventually show up, blast everything to rubble, and ask the Administratum to recolonize the ruined world. By contrast, the Ship is humanity centralized and utterly, utterly invincible.
And third, the Emperor woke for the first time since the heresy and ordered the ship be built around him. He is the God-Captain, and only he knows the destination.
Pic related, coolant reclamation basin XRP7686 Ursani.