Its cheaper to house and feed them in the minimum than have to pay to jail them or repair the damage they do on the street.
If society weren't so hostile to some people, maybe they wouldn't shut off to participating in it. And even for those that don't - it makes financial sense to macroeconomically attempt to minimize the frequency of economic drop-outs but microeconomically it is much better to not just ignore the ones you have and force them on the street, because they cause a lot of property damage, which lands them in jail, where they got over a hundred thousand a year to keep imprisoned.
I'd agree on the benefits of providing housing, but you're probably not going to want to make it mandatory (what's the alternative? jail? that's wasteful) and you can damage a lot of property in a housing situation too (if not more).
So economically, there has to be a recognition that some people are going to give up on the system and decide to stop trying to please a brutal economic machine, and that some of them may even become bad actors, in order to develop a realistic plan.
What's the long term plan for people in that situation?