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.