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.