Keep in mind that Gondor didn't just have attacks from the east to worry about. There were a lot of possible avenues of attack that needed to be covered - in many cases with a not inconsiderable number of troops to be held effectively.
For one, the coastal cities of Gondor would have been under constant threat from Umbar's naval supremecy. Pelargir was under continual siege from Umbar's corsairs until the Army of the Dead drove them off. And that was (IIRC) one of the largest and most prosperous cities, which would logically have been one of the more heavily defended ones. It's quite likely that other coastal cities, presuming they'd not already been attacked and sacked, would have been unwilling to send troops all the way to Minas Tirith to fight (what is to them) a far less pressing threat - particularly when one considers that it was highly unlikely that any troops sent would ever have returned alive. Looking at a map of Gondor, it can be seen that a fairly large amount of the country isn't that far from the coast. Thus the leaders of the western provinces could very well have decided to hoard troops in the event of Umbar attempting a naval invasion.
Secondly, Gondor needed to defend itself from attacks coming from the south. This would mean deploying a fairly large garrison in Harondor to defeat attempted invasions from the Harradrim and Umbar. I daresay it would take a not inconsiderable number of troops to discourage attacks from a nation with access to Mumakil. Though considering that the Harradrim did indeed turn up at the Pelennor Fields, these forces were most likely destroyed shortly before the final assault.
Thirdly, the river crossings at Cair Andros and Osgiliath also had to be defended to prevent attacks from the north. Given that these would naturally be key positions in the war against Mordor, Gondor probably expended the majority of its available manpower in trying to hold these cities. While troops at Osgiliath could have retreated to Minas Tirith easily enough, the forces at Cair Andros would have had no nearby cities to retreat to. By the time Mordor's forces finally managed to cross the Anduin, Gondor had most likely been sapped of nearly all of its manpower by trying to prevent them doing so.
Finally, while Isengard was still a threat, the passes through the White Mountains would have required yet more troops to garrison against possible attacks.
As you can see, Gondor is in a pretty shit position defensive wise. It's not surprising that they had relatively few troops available to be deployed to Minas Tirith. Those few that were available would most likely have been thrown into the meatgrinder at Osgiliath in a futile attempt to prevent Mordor's forces from gaining access to the western regions of Gondor.
And I can kind of understand their thinking. Even with a miniscule garrison, Minas Tirith should have been capable of holding out for weeks. A large garrison is completely unnecessary to hold the city.
Also, we need to take into account the comparative worth of garrisoning either Minas Tirith or Osgiliath. If you deploy a large army at Minas Tirith, what do you get? Well, you make the city even harder to take. But it does nothing to stop the enemy moving west to conquer the western regions of the country. The Orcs would simply have laid siege to the city and prevented the garrison from sallying forth, intending to break them by starvation. But even if they were unable to do so, they'd still have reduced all of Gondor to ruins, leaving them completely incapable of ever being a threat again and ready for future invasions.
If you deploy a large army at Osgiliath, however, then you deny the enemy the ability to move west. This leaves the rest of your nation protected from invasion, allowing them to farm, produce weapons, recruit new troops, etc.
All in all, witholding large numbers of troops and filling Minas Tirith to the brim with troops would have done little but ensure Gondor's defeat. Even if the White City wasn't taken, the nation itself would never recover from the devastation that Mordor would have dealt to the western provinces. Indeed, leaving so few troops to defend Minas Tirith probably saved the country.
"You've all been selected for this mission because you each have a special skill. Professor Hawking, John Leslie, Phil Neville, the Wu-Tang Clan, Usher, the Sugar Puffs Monster and Daniel Day-Lewis! Welcome to Operation MindFuck!"