The biggest contributor to homelessness is unaffordable housing. The best solution for homelessness is... giving people housing. It is a remarkably simple cause-and-effect.
Yet, that's now what we do. Many people view homelessness as some kind of personal moral failure. when, in the US in particular, you'll be surprised how close most Americans are to homelessness. It takes surprisingly little to go wrong to end up there.
We would rather spend money on things like policing homeless people, even incarcerating them, which is objectively more expensive than simply housing such people.