In the homelessness example, it's not so much that the programs and groups want to justify their continued existence (though that might be happening too). It's that the programs themselves incentivize more of the problem. When they give things to homeless people, such as food, shelter, clothes, social services, even needles and a "safe place" to get high in some cases, and often with few or no conditions, they make being homeless more tolerable. Word gets around, and people who could not feasibly be homeless where they are are drawn to Portland because they will get more support there.

None of those things make homelessness appealing in any absolute sense. Like, if people had a (reasonable-to-them) path to getting a home, the vast majority would go for it even if there were a bunch of services available.

The real answer is that the electorate is vehemently opposed to providing paths like that if those paths feel even remotely like "unfair handouts". Votes hate that idea even if it would be empirically cheaper. We collectively preserve the problem of homelessness because we feel like people who can't/won't work deserve to be unhappy, because we believe that we need the threat of homelessness to coerce people into working, because we believe people on drugs/etc are undisciplined and immoral, because... well, you get the idea.

Jail time is a sure spiral into unemployment and homelessness, privations, and more jailtime.