From my experience helping in groups like Food Not Bombs (though I don't have any actual experience being homeless, so grain of salt here), It would seem that there are a number of factors that can make some one homeless.
I think the main factor being that you don't have the friend/family support that a lot of people have. Could be because your friends/family just doesn't have the funds or resources to help ya in hard times, could be because your family is toxic and being around them is worse for you than being homeless, could be because an addiction has caused ya to burn every bridge, could be because severe mental health issues have made getting help difficult to do, or it could be some combination of these things.
I'd have to agree with
@Coywolf that in my experience it seems that a large portion of the homeless population in cities seem to be hit hard with addiction, and it's a reasonable concern as to whether free housing will help fix that issue or enable it.
But in my opinion, telling someone that they will only get free housing if they go into treatment is just as naive as giving someone housing for free and expecting that to solve the problem. I think many on this forum have met people on a personal level that are so in the grips of addiction that they would sleep outside if it meant they could keep getting said drug. And while yeah someone on hard drugs might ruin the housing or further their addiction in free housing, they will keep using if homeless and will cause other issues outside of the free housing. I think your just moving around the issue.
Free housing first would help all homeless to some extent. Somebody in just financial dire straights could get back on their feet, and somebody with mental health or addiction struggles could have clearer thinking when they aren't worried about their stuff being stolen, worry about being assaulted, and where they are going to shit/piss. (Once again this is just my opinion developed through talking and helping to some extent, and I am fortunate/privileged enough to have had no real threat of being homeless on my life.)
Though I strongly believe that any real reform direct harm reduction efforts have to include presenting the options for recovery or helping to make that possible for those who can't just afford to go to rehab.
I recently visited a harm reduction group that gives out safe supplies. While I see where they were coming from and the benefit of what they do, I was very disappointed that they had next to no resources for people who would like to stop. While I understand that pressuring people to stop would make them hesitant to come and get assistance or safe supplies, how difficult would it be to have a sign saying you have resources for people trying to quit and just have photocopied lists of different resources in the area? But then again, I am not the one doing the work, so I guess who the hell am I to judge how they go about it? Just seems like a missing piece of multiple harm reduction groups I've checked out.
Anyways, that's my 5 cents.