So the way I figure, you spend money on imprisoning (though private prisons make more money and can sell non-violent labor).
Or spend money on housing and social workers and maybe a good chunk of this individuals rejoin the workforce and pay taxes.
Or you spend money on cleaning up after, paying for medical emergencies, and increased private security costs.
The option selected is either the one that the invisible hand found to be the most efficient or a better option was not sold well enough.
A common meme on both sides of the political aisle is that public spending that they don't like is motivated by someone else's profit, but that's never the why the spending happens. I'd like the government to give me a million bucks to dig a hole in my backyard, but that's not going to happen unless if the voters agree to it.