As long as "much higher" is 2x the national average, Bay Area residents still come out ahead, especially on gross cash basis.
Median household in SJ earns ~120k. Median for USA is ~$60k.
Even if the SJ resident spend 40% on housing, they come out WAY ahead of the median household spending 25% on housing.