I understand a replacement shuttle being commisioned as was the case with the Challenger disaster. But what was the need to have four fully operational space shuttles at the same time when we never sent more than one in to space at a time? I'm excluding Endeavor and only stating four because initially four orbital shuttles were constructed, i just can't find why so many.
Multiple Shuttles were needed in order to maximize flight rate, which was key to keeping per flight costs reasonable, as well as provide sufficient launch services to carry out required missions in a reasonable timeframe.
From its inception the Shuttle program was sold as a high throughput, low cost launch system. In practice it fell enormously short of those goals. One of the core problems of the program was that it was not, strictly speaking, a properly reusable launch vehicle. During every launch much of the launch vehicle stack was discarded in flight, and each nominally "reusable" Orbiter required extensive refurbishment, reassembly, and parts replacement between every flight. This typically took months of calendar time and made use of roughly 3/4 of a million work-hours (375 "work years"). Moreover, to enable this process required keeping an enormous standing army of engineers and technicians on hand, which was extravagantly expensive. These high fixed costs meant that the annual cost of just being able to fly a Space Shuttle was very high regardless of how many you actually flew.
Meanwhile, the incremental costs for adding a flight were fairly modest (not in a strict sense, they were still hundreds of millions of dollars, but in comparison), so the easiest way to minimize per flight costs was to maximize flight rate. Keep the Orbiter processing pipeline at maximum capacity so that the super expensive standing army has minimal downtime and you get the most bang for your buck. And that required not just multiple Orbiters, but several of them, so that they could be in different stages of processing (or preparing to launch or in space) at any given time. Additionally, because Orbiter upgrades took even longer and could take an Orbiter out of service for a year or more it was necessary to have enough vehicles to take up the slack.
During the early years of the Shuttle program there was still a lot of fantastical thinking that the system could possibly live up to the grandiose promises that were made to sell it to all the political powers that kept it alive. This was wholly unrealistic as those promises were, at best, astoundingly optimistic by several orders of magnitude. Nevertheless, getting the most out of the program by keeping the flight rate as high as possible was still seen as an important goal. As the program transitioned out of the testing phase and into the operational phase in the early '80s there was intense pressure to increase the flight rate in order to prove the worthiness of the program. Especially so since the program had a very high public and political profile at the time. This pressure led to an unprecedented 9 Shuttle flights during 1985, among only 3 Orbiters in service (since Columbia was undergoing modifications which ended up taking 18 months).
That pressure continued into 1986 and contributed to the reckless decision to launch flight STS-51-L (Challenger) in very cold weather against the advice of engineers, the result was a failure that caused the loss of vehicle and crew and grounded the program for almost two years. After the Challenger disaster a greater degree of sanity fell onto the program, along with a more measured pace between flights for each Orbiter, with less pressure to pump up the flight rate. They kept the fleet at 4 because that kept the flight rate maximized under those conditions.