People can't compete. People who would normally work in those kind of working class jobs are more likely when they get unemployed to not be able to do anything else. So they become homeless. Drug addicts become homeless because there's no real rehab program. You get the product from the people that you throw away.
Prison serves many purposes.
It houses the people you don't want, the people you're scared of, the people who fight you, the people who need to be eliminated or controlled and you make a business out of it. And there's no alternatives. Every study they've done for the last 25 years or more, tells them that alternatives cost less, are more successful, are more humane, are reflections of a more caring society. But they don't give a shit about that. If they gave a shit we wouldn't be in this mess.