Glad you asked. The problem is partly because housing is a commodity. Everyone from the developers to the banks have the incentive to build the most luxury unit they can sell -- developer gets more rents/sales, bank considers units less risky, etc.
There is a pressing and urgent need for more housing, but there is also a huge eviction crisis in those same cities.
So what can we do?
Public housing/Public funding for housing -- fund both capital and operations publicly, paying developers more to incentivize building non-luxury units.
Tax empty units -- Taxing units that are empty reduces speculation in homes. It should not be financially possible to buy housing and leave it empty as a way to store value.
Rent Control -- Limiting rent increases tenant control over a neighborhood, limiting the amount of speculation and acting like a bit of a brake on market rate.
Build More -- Upzoning, especially with regulations that require more units per lot and require moving tenants to equivalent units while construction is ongoing. It's no good to tear down a bunch of townhouses and put in an apartment building with the same number of units.
Eliminate minimum parking -- Parking takes a massive amount of space. Especially in an urban core. Use that space for housing people not cars.
Decommodify Housing -- Make it less profitable to be a landlord. Give tenants right of first refusal in the sale of their buildings, form housing coops, guarantee tenants representation in legal battles, create stricter laws around evictions. If it's less appealing to treat housing like a commodity, it's easier to push for housing as a right. All of these things are about making small chips away from the power of landlords to extract rents.
Affordable Foreclosure Insurance -- Insurance helps ensure people can stay in their homes, upkeep their homes, and continue to contribute to the neighborhood. Reduces the amount of home flipping pushing prices upwards.
Community Land Trusts -- There are groups that buy land/houses and sell/rent them at below market rates (with the rider that the property must be sold later at below market rates.) In Seattle, for example: http://www.homesteadclt.org/ By putting downward pressure on market rates, you further decommodify housing and make it easier to push for reforms that make the ROI better for housing more people rather than more luxuriously.
Stiffer Penalties for failing to upkeep apartments -- When apartments fall into disrepair, whole buildings need to be taken offline or people refuse to live there. Requiring high standards in maintaining apartments ensures that the housing we do have doesn't get taken out of circulation too early.
Edit: I'm assuming you asked in good faith. I don't think we need to do all of the above. I don't think we can do all of the above right away. But combinations of the above I think are achievable and could lead to better communities. Happy to discuss any of them more, provide more resources, etc.