Since only one Space Shuttle orbiter was ever in space at a time, it seems logical that only two would be needed: one for the mission and the other as a backup for an emergency rescue. Perhaps a third could prove useful if one is in for repairs while the other two are mission-ready. Why, then were four orbiters—Columbia, Challenger, Discovery, and Atlantis—initially built?
As projected development costs for the shuttle climbed, the only way for it to appear to be more cost-effective than expendable launcher options was if it flew a very high mission tempo, about one launch per week. With such rapid turnaround times, four orbiters probably wouldn't have been enough, and more would have been ordered.
In the end, launch tempo was more like 7 launches a year, which was appropriate for a four-ship fleet. Maintenance of each orbiter between launches was extensive, taking at least two to three months, so it wouldn't have been impossible to need one on-mission, one being stacked for the next mission, one undergoing normal between-flight refurbishment, and one undergoing more extensive repair if anything went wrong.
The Space Transportation System was intended to provide the United States with a low-cost, reliable means of transportation into low Earth orbit. The expectation was that all United States space launches would take place on the STS fleet. Four Orbiters were required to meet the expected demand and flight rate.
The official US government policy in 1982 was that STS would be the primary launch system for both military and civil space missions. It stated that "Expendable launch vehicle operations shall be continued by the United States Government until the capabilities of the STS are sufficient to meet its needs and obligations." (italics mine, showing that expendable launch vehicles were to be phased out)
None of this played out as planned.