A wide river is a significant barrier to the movement of troops as they must cross the river by ford, bridge or boat, which slows them down and makes them vulnerable to attack.
There are places where such crossings are easier than others, and these are the places where bridges and cities are built. That must explain why Osgiliath was founded here, and we know that there was a stone bridge over the river at this point (until it was destroyed). I think we can assume that Osgliath is a good place to cross when attacking Minas Tirith.
Denethor explains why he believes it is where the crossing will be made:
‘Yet,’ said Denethor, ‘we should not lightly abandon the outer defences, the Rammas made with so great a labour. And the Enemy must pay dearly for the crossing of the River. That he cannot do, in force to assail the City, either north of Cair Andros because of the marshes, or southwards towards Lebennin because of the breadth of the River, that needs many boats. It is at Osgiliath that he will put his weight, as before when Boromir denied him the passage.’
The Lord of the Rings Book Five, Chapter 4: The Siege of Gondor
Page 816 (Houghton Mifflin Harcourt; Single Volume 50th Anniversary Edition)
Denethor's judgement was impaired by Sauron's influence, but he understood strategy. I think we can believe his assessment that crossing at Osgiliath was the most advantageous place for Sauron's forces.
I should acknowledge that the maps show the river bends west as it goes south of Minas Tirith and is much closer to the city at the Harlond (south-east of the gates) than it is at Osgiliath. I think we must assume that there are reasons (perhaps the width of the river) that make this a difficult crossing point for an enemy force.