This is true but not in the way that you mean. As you said there is no shortage of space. But it's important to point out that on a global scale there is no housing shortage either. Vacant dwellings outnumber homeless people by far in most industrialized countries where homelessness is rampant (for example: 3 million empty dwellings here in France).
You seem to imply the problem is housing regulations and NIMBY preventing new constructions, but who cares when the houses are already there. I agree with you the problem is that of policy, but i would say the policy responsible for that immense suffering is "private property", the religious belief that land should be owned and that a piece of paper should dictate whether you can sleep under a roof or not and/or have access to food/healthcare/education.
We can eradicate homelessness in under 48h: it's just that no politician cares at all about poverty from their ivory tower! Just give the police instruction not to intervene for "breaking and entering" in *vacant* housing (or even better, abolish police entirely) and we can rehouse every homeless person in the next two days. Of course it would take a few weeks to rehabilitate some of the housing unit and make them real decent, but even in the meantime old housing would be much better than no housing.