The Doctor hadn’t understood, nobody had, until Amy showed them.
Everything they’d been doing had been completely unnecessary; they’d caused unimaginable suffering to an innocent creature for no reason. All the Star Whale had ever wanted to do was to help. The last of its kind, alone in the universe, it had sought a new purpose, but instead of accepting the help it freely offered, they’d trapped it, built on it, made it their spaceship and forced it to cooperate by means of torture.
So Amy freed it, but it didn’t leave. Now it carries humanity across the universe willingly.