> Why wasn't 5 Hubble telescopes launched? The marginal cost for the other 4 must have been vastly smaller than the first.
Economies of scale only apply at, well, scale. Five Hubbles would cost 5x one Hubble to construct. There's very little in the way of savings because most parts are custom fabricated. The parts need to be tested, integrated, then tested after integration. The testing and verification of each subsystem takes the same number of person-hours. So testing 5x the systems requires 5x the time.
You can't just accept a high failure rate of something the size of Hubble just because you've built five of them. If you launched a Hubble and it failed in some Loss of Vehicle fashion after inserted into orbit you've got a big uncontrollable mass of telescope flying around the Earth.
Even if we still had the Space Shuttle (or a fantasy version of the SpaceX Starship) flying an uncontrollable Hubble couldn't necessarily be retrieved. If it wasn't accepting commands and was spinning on some axis it would be too dangerous to approach with another vehicle. Even an unmanned vehicle couldn't necessarily approach it without a collision that causes even more problems. See the recent idiotic Russian ASAT test for an object lesson in what could happen.
This is all to say you don't want some large satellite in a long lived orbit to fail. So there's no savings on testing and verification. Even though at launch Hubble's mirror had problems the satellite itself was fully under control and operable.
Something like Starlink is very different. All the satellites in a given block are functionally identical and fungible. If one fails it's easily replaced by another. They also deploy to a low unstable orbit. If a Starlink satellite fails and is uncontrollable it will de orbit by itself quickly. They must be functional to enable the onboard engines that get them to a stable intended orbit. A Starlink satellite then needs far less testing and verification than a Hubble or JWST, not that they can be poor quality but they don't need to function Or Else Bad Things.