tangent: I've been to some restaurants that charge $5+ for a fountain drink, presumably to mitigate the lost profit on alcohol. it would be interesting to know why the business model is that way, instead of just pricing a moderate profit into both food and drink.
That's only compounded by the tendency for drinks and sides to be impulse-purchases - easy up-sells that no one walked in intending to consume. And, if choosing the $5 burger has maybe embedded the idea that your place is "cheap", then so much the better, as that makes them likely to spend a little more than they would have at the other place: "I saved $2 on the burger, so I can afford an extra side!"
Tl;dr: Commodity restaurants are trapped in an equilibrium where food has to be a loss-leader for sales of drinks and fries.