Much of the problem of homelessness is related not to drug use, alcohol use, or unfortunate economic situations;  the majority of the problem may very well be related to mental illness. 

At one time, many individuals with  severe mental health issues  were placed in  state facilities, admittedly not always the best solution, but at least an attempt at one, until they were ready to rejoin society.

Unfortunately, the fad of sending  these individuals back into the general public, well before they are prepared to be sent (in a few cases never),  took hold when  effective anti-psychotic drugs were developed. 

Almost none of these unfortunate individuals will on their own stick to the medication regime that they need to in order to function effectively in society, 
but, hey, at least it saves the state money to close down mental hospitals.