If you limit the problem to "some people who want a house don't have enough money to afford living space qualifying as a house", then broadly speaking market solutions are possible because we can assume these people participate in the market via their "demand" and their ability to "supply" something in return. Obviously there's an active debate on many market issues here, whether around too much market regulation (eg NIMBY), or too little market regulation (eg minimum wage).
However, my understanding is that there is mounting evidence that the homeless population is composed of people who have either no demand for a house ("free spirits") or no ability to supply anything to the market (mentally disabled). Obviously in these cases the market is not very useful, and only functions insomuch as those outside of the homeless population include it in their "demand function".
In my opinion, to solve all of these predisposing/causative factors, we'd need a much much stronger healthcare system, and probably UBI or a strong welfare system, to cover all the above scenarios. Even so, good healthcare and welfare won't matter that much in acute emergency scenarios, for that we need vigilance and persistence and unrelenting altruism.
"This enormously regulated industry doesn't yield outcomes we like for the poor! Obviously markets cannot solve this problem!" is a disturbingly common argument.
See San Francisco as an example of what happens when more money is poured in the "modern" solutions - very little reduction of the problem, if any.
So yes, markets failed to provide very cheap housing and not for lack of cheap land or costs of construction. It's just because they provide even worse profit margins. Deregulating the industry won't help with that.