Most Western countries could eliminate homelessness in one day if it was just about the beds in shelters. People opt for a straet instead of a shelter mainly because: it may not be safe there ( drugs, alcohol, aggressive behaviour) or they are on the other side of the spectrum, such as drug addicts, mentally ill and etc. Usually a holistic approach is needed.
Yeah if it was just about having enough beds somewhere then we wouldn't have issues. But there is a lot of mental health, addiction, and trauma -- often feeding off each other, e.g. people with metal health issues turn to drugs to self medicate -- and that requires more than just a place to keep them.
In a lot of cases it's more about harm reduction (to themselves, and to the local community) then getting them fixed in a home. Cuz you're not going to rehab some of these people.
The tiny handful of people who are homeless because "they don't like the rules, man" are statistically irrelevant.