I suppose that much of it is owned by people who have not done the math. Many of them would never invest in the stock market anyway because they find it too risky. Some might have bought at high prices, others might have bought a long time ago at more reasonable prices or inherited. I think that many of the latter people never go back to re-evaluate whether it is still good to own.
Of course, if you own your residence in such a place, and you are happy there and you love your house, then keeping it might be a reasonable decision. Even if it does not seem to make sense in the cold blooded financial analysis.
I do not know whether these work as explanations in the cities you mentioned, but I am pretty sure that it describes the situation well in many German cities where I compared owning and renting. If you ask real estate owners here what their Return on Investment is, they often have no clue what that even means. In their opinion "renting means throwing money away" and that's it.
I think this is a large part of it, certainly among residential homeowners (and many "mom and pop" landlords). If it all came down to cold blooded financial analysis by informed and rational market participants, then, absent other external forces that artificially inflate or depress market rates (for example, rent control regulations in NYC), situations should never exist where it is sustainably much cheaper to rent than to buy (or vice versa), because market forces would operate to establish an equilibrium.
Because local real estate markets can be highly inefficient, there are deals to be had even in expensive markets. I bought my two-family row-house, which was not marketed well, for a good price (but still obscenely expensive by national standards). In addition, I collect obscenely high rental income from its rental unit. As a result, my housing expenses are lower than they would be for a comparable rental property. However, it is true that I would probably be better off financially (but not by much) if I sold the house today -- every day that I decide not to sell is the economic equivalent of deciding to repurchase the house for its current market value minus transaction costs. Yet I don't do so, primarily for the psychological and intangible benefits of keeping it.
The same logic extends to living in HCOL areas in general. The OP could have asked why does anyone live in a HCOL area (unless they are being financially compensated correspondingly for doing so) when they can live more cheaply elsewhere? The answer is the non-financial benefits to be had by doing so.
The Brooklyn I was born into in 1980--a place most people wanted to escape
from--has morphed into a magnet that people the world over are now attracted
to. In retirement, I could capitalize on that and flee to another city which sits on the receiving end of the geographic arbitrage relationship. Instead, I plan to stay put, partly because I am deeply in love with this city, and love makes you do crazy things.
My wife and I half-seriously joke that we hope our house stops rapidly appreciating, because, among other reasons, we don't want to reach the tipping point where we
would decide to leave.