Here is a graphic comparing the size of the middle class within each MSA. What the cities at the top of the list have in common is affordable rent. And the Closed Access cities - urban California, Boston, and New York City - fill up the bottom. Notice how most cities have a middle class between about 47% and 54% of the population, but for those bottom dozen or so metropolitan areas, there is a real drop off.
Below I have also pasted a graph comparing Zillow's measure of rent affordability for the largest 100 metropolitan areas. Notice that this is the mirror image of the measure of the middle class. There is the same sharp deviation from the norm at the bottom of the list. The worst cities are the same coastal metropolises. The same cities appear at the top of the list, too.
And, rent is expensive in the Closed Access cities even though the missing middle income households have largely been replaced with high income households.
The coastal cities are hollowing out the middle class, mostly by refusing to build homes.