We loaned money to companies and gave them land as an inducement to get them to build the railroad. The loans were repaid, with interest. The previously worthless land was now worth something, and land retained by the government was sold for money.
There was now an infrastructure to produce settlement, which begat other local governments, and new taxes for them.
Literally everybody won. Except maybe the indians. And there are no indians, or perhaps even life, in space.
Oh Goody! Did somebody say "reparations"?