Well, only a small portion of the Bay Area is wealthy. It's ground zero for income inequality; they have millions of people mooching off government.
You don't know what you are talking about. The Bay Area economy hires lots of people making salaries in the 70-150k range. That's how you get the high median incomes you see across the board in the Bay Area. I mean, Oakland has a median income that is almost the same as the nation as a whole. In places like Socal or even NYC, you see high average income perhaps but median incomes are quite low compared to the Bay Area.