There is no housing shortage, there are more vacant homes than total numbers of homeless in the US. It’s just that capitalism creates a permanent underclass.
Define "vacant" home. The house next door to me was empty for two months while it was being sold and before new owners moved in. The house across the street from me has been for sale for months. It is impossible to house homeless in houses for sale; the sellers and buyers would never accept it.
The same thing happens with apartments. They are vacant for a month between tenants or when finding new tenants. Landlords would never accept temporary tenants who couldn't pay.
People holding houses for investment happens, but most rent them out. The few that don't are pretty rare and not enough to affect the housing market.
The problem of low housing supply is not a problem of capitalism. It's of nimbyism, restrictive zoning, car-dependency. Capitalism's hey-day was late 1800s and cities ballooned like crazy.
The same thing happens with apartments. They are vacant for a month between tenants or when finding new tenants. Landlords would never accept temporary tenants who couldn't pay.
People holding houses for investment happens, but most rent them out. The few that don't are pretty rare and not enough to affect the housing market.