But rich cities can also have great public transit. New York, London, Paris, Berlin, Tokyo, Seoul, Beijing, Singapore... in fact rich cities with transit as awful as the Bay Area seem to be the exception, not the rule
They are all much more dense than the bay area, and I don't get the sense that many people want them to be denser other than, again, for affordability reasons.
I don't have data but in Moscow where I'm from the typical well to do thing was moving to a "cottage village", something between a suburb and a gated community, despite good transit and horrendous traffic. In the 90ies it was stereotyped as a nouveu riche thing but in 2010s I even knew a senior dev who did it as it became more affordable. When I was visiting Tokyo iirc most local devs I was working with lived in the city but their manager lived in an outlying less dense area, since presumably he could afford it). I get a sense that people are likely to move to have more space and privacy, unless it's locally difficult or expensive.