The middle class can afford to live in cities, just not in a 3500 sqft house with a 2 car garage and a boat, and with the best school district and certainly not in NYC, SF, Boston, DC, etc. There are plenty of places to live in America. You have to adjust your standard of living and your expectations according to your income and desires.
This is a view that will lead to a highly dysfunctional society. First off, you are dismissive of the issue with that bit of exaggeration. It is not as if this group wants all the good things in life that only a tech salary afford. Perhaps a dignified life would be sufficient. You also place NYC, SF, Boston, DC, etc. into a category of city that is naturally not available to the middle class. Is NYC a luxury like a 3…
Once those cities are unaffordable for the very people you mention, they will just move to more affordable places where they have a better cost of living, and then they will bring ideas, creativity, and resurgence to these areas and make them better.
If you're a critical worker, then surely you can demand a pay raise. If not, move. If somebody can replace you, you're not critical. If somebody can't replace you, they'll have to pay more.
I'm not dismissive of the cost of these cities at all, nor the plight of those living there, but you get what you pay for. If you're a teacher in New York and you can't afford rent, move somewhere else instead. What else are you going to do? Rent control? Then you just have people who can never afford to build lasting wealth because they will just rent for life.
There isn't a 'solution' to this 'problem' because it's just a basic fact of human organization. I'd love to live in Colorado, maybe Breckinridge, but I can't afford that. So I live somewhere else and visit. Does that suck? Yeah sure, it also sucks I can't buy a Ferrari.
Ideally we want mixed-use development neighborhoods with differently priced homes for people with different income levels to live in. But it looks like without the government enforcing it, that isn't going to happen.