Actually one of the reasons big infrastructure projects were undertaken in the middle ages was just the opposite: to provide a reason for an economy to exist. Something for the population to do.
Most spectacularly this is seen in Cathedrals, but castles, certainly some castles, definitely show this. I would argue pretty much everything the Romans built is more than a little overspecced, certainly at construction time (do you really need 3 story POOLS, meaning pool on -1, pool on ground floor, pool on first floor, pool on 2nd floor buildings ? Yes the higher ones were apparently rented out to very rich Romans, or more often provided as favors to them, so there was some function, but ... come on. They were constructed to mostly look very convincingly to be 3 story pools without actually being that. Despite that, none of the buildings survived for very long. But "over the top" can be said about many Roman structures, from the Pantheon to the Aya Sofia)
So having an unnecessarily big infrastructure project has it's own advantages that actually increase your odds of survival, and that didn't start with the space race.