It'd know it needs data centers, ahh and probably a large security perimeter around those. And look at that, the proliferation of data centers has effectively turned the non-data-center land into the enclaves, etc. etc.
But still, are you aware that getting a single Starship just to Moon will require 10-20 Starships to refuel it?
Even the optimistic case of Starship hardly makes any dent whatsoever in this equation.
I think any vision of AI that is smart enough to move planets but dumb enough to display the lack of foresight you describe is unbelievable. But we all choose a different level to suspend our disbelief I guess.
We will create AI capable of "helping humans to protect their cities from an increasingly hostile atmosphere" long before we build one capable of doing anything meaningful in outer space.
(To be clear I don't really defend/endorse this vision of the future, I'm just playing devil's advocate here)