San Francisco can be a playground for the rich until they get sick of paying for $30 lattes or whatever and flee to low cost locales like Manhattan that have affordable housing and transit.
It won’t be “fixed” until we’re backed into an economic corner where it becomes politically acceptable for the property owners to lose bazillions of dollars.
I don't know how you got to that, other than by assuming that nice areas have to be expensive. The fact that SF is unable to achieve both is an indicator of broken local markets and politics, not an ironclad rule for every other locality.
Edit: Another framing is that "nice" and "fancy" are different things, as much as extremely unequal markets like SF distort the distinction.
This is generally the case. I can’t think of a single counter example.
Most of the US satisfies these constraints, especially if you own and don't mind driving a car.