The real answer is that the electorate is vehemently opposed to providing paths like that if those paths feel even remotely like "unfair handouts". Votes hate that idea even if it would be empirically cheaper. We collectively preserve the problem of homelessness because we feel like people who can't/won't work deserve to be unhappy, because we believe that we need the threat of homelessness to coerce people into working, because we believe people on drugs/etc are undisciplined and immoral, because... well, you get the idea.
You know what does though? Making it really hard to get a home. That makes more people homeless. I hope that's obvious.
When I was there, I counted about 2 drug users out of 100 people in a shelter in Spokane, Washington. The rest were either ex convicts, disabled/mental issues, or just simply lost their home.
No family nearby. No friends willing to take you. No money to pay for rent even in the cheapest areas. No cheap temporary accommodation nearby of any sort. No government provided emergency housing available.
If you want to make it personal, I live in Sweden. There are lots of options available and no one lives on the streets if not for a mental illness that prevents you from seeking help, as help is available and easy to get. You can get a salary for indeterminate amount of time and pay for your own accommodation as long as you show you’re looking for jobs. If your job pays too little you can get a stipend from the government to pay for rent and food. So yeah I am sure I would never get homeless even if everything went wrong for me. If you live in a country where that’s not the case, you should really question what should the priorities of your country be (notice that basically all developed countries in the world and even many developing ones provide everything I mentioned above, with possibly one single, big exception).
I don't know about you, but that sounds horrible to me. I don't see how anyone can be surprised or aggrieved that some people choose to stay away from them under those conditions.