No, seriously, it's insane that you're trying to defend this claim.
Median US household income after taxes in 2022 was $64,240. If you make *quadruple* median household income after taxes, you are not middle class.
Median post-tax household income was $34,123 in 2000, so $140k was quadruple that too.
Median pre-tax household income in San Francisco is $126k.
The standard guideline for an apartment being affordable is "30% of your pre-tax income or less"; a $3k apartment would be affordable by that metric for someone making $120k before taxes.
In San Francisco itself, single-family houses do start at around $1M, but it is not remotely true that you need to spend $2M for "something decent" - there are tons for like $1.2M, I'm looking at Zillow right now. You can get a two-bedroom condo in a pretty good neighborhood for like $750k.
House price affordability guidelines are "3-5x pre-tax annual income", so even in SF, the paradigmatic housing-crisis city, you could afford a $1.2M house on $250k or a $750k condo on $150k.
All of this is just setting aside the question of "if you can just afford to buy a house in one of the most expensive places in the country, does that make you middle class", for which the actual answer is no.
But by absolutely no sane metric is $500k/yr "squarely middle class".