I have multiple layers of safety nets between me and long-term homelessness. These include my own personal resources, my family and friends, and access to government assistance. (My family has been on government assistance in the past; we struggled but we were housed and fed.) I can only see myself exhausting (or failing to utilize) all these safety nets if I develop severe addiction or mental illness, and in fact most long-term homeless people do have addictions or mental illnesses.
What do you think happens when someone with out-of-control addiction or mental illness is given a place to live? In the absence of strictly enforced rules (and such rules are one reason many long-term homeless people don’t want to be in shelters) that place will soon be a wrecked crime scene. No matter how many empty buildings there are, almost no one would want that happening to a building he owns, or to a building near where he lives. This is why San Francisco (and many other cities) spend so much per homeless person without success - if simply giving them a place to live worked, cities would have more money and fewer homeless people.