It's a tired and inaccurate meme that "homeless people are all junkies and crazies who aren't trying hard enough to solve their personal issues." I'm talking about housing issues and what needs to be done to redress a nationwide shortage of affordable housing.
Lots of millionaire rock stars are also junkies and it doesn't land them on the street. They go in and out of treatment but still have sometimes multiple mansions. I see zero reason to believe that drugs and alcohol are some primary cause of homelessness.
Homelessness is a complex issue and people want a simple answer. The simple answer is that we lack affordable housing nationwide.
Another fairly simply concept that applies broadly is that you end up homeless when your problems exceed your support resources. The difference between a homeless person and a housed person can be one more problem or one less resource, whether a good friend, a steady source of income, a family doctor or some other form of support that helps you make your life.
Some number of the unsheltered homeless are drug addicts, and some of those became drug addicts after they were homeless, because being homeless is soul crushing.
You need to be asking the true cause of a lot of this homelessness, and also the cause of the cases where folks became homeless because of drug use. A very large percentage of all homeless are veterans (20-30%) and california has the highest number of homeless veterans (so the percentage is likely higher there). Most folks become homeless due to costs, not drugs. The most visible, aggressive homeless are likely drug addicts, and those are the ones you notice, but they aren't properly representative of the problem, and your characteristic of the problem makes the problem worse, not better.
While I don't think it's a good idea to force people into mental health or drug treatment against their will (e.g. involuntary commitment) just because they are mentally ill or addicted. But I do think that if they are busy committing strings of dozens of misdemeanors, stealing, openly using meth and fentanyl, etc. that this is the perfect opportunity to actually enforce the laws on the books. Then it is the state that can decide to show leniency by sentencing and enforcing treatment.
Poof! now you would have only 5% of the nation's unsheltered homeless instead of 50%. The rest would a minimum be sheltered. They could then be treated for mental illness and weaned off drugs. It would probably save the lives of many.
Taking a ridiculously permissive stance on squatting, stealing, drugs, trespassing, property crimes, etc. is not humane. On the contrary, it is 100% causing the situation.