The little moral grandstand you describe when passing a homeless person does nothing for them.
You abhorr the idea of someone in abject poverty wanting a way out so you hold up a utopic idea as to how things should be - but no solution to get there.
UBI? Immediate huge drop in economic input from working people who won't have to work anymore. And within a couple of years, not enough productive people left for UBI. Don't bother linking those studies on UBI boosting the economy, I've read them, and I think they're typical soft-science nonsense. I have a lifetime of observed experiences that tell me what happens when people don't have to make any effort to get by: from children, to friends, to animals, to entire populations like Kuwait (where anyone with a job is gifted $3000/month by the government on top of their salary. This resulted in the laziest, least competent people I have met, who just hire foreigners to do their jobs for them. It reminded me of Wall-E.)
Communism? It has never and never will work. As soon as you remove private wealth, whoever is in charge becomes a perpetual dictator within months, since any objectors depend on him for their survival. Nearly instant dystopia.
I'm really curious, is there ANY scenario where someone like yourself will demand that a homeless person become a productive citizen? Let's say you offer them magical housing and a magical job. They trash the house, don't go to work, and stay at home taking drugs. What then? Do you continue supporting them? Endless counseling? Let's say it doesn't work, no matter how patient you are, they refuse to work. Is there any breaking point where you are able to tell them "if you don't clean up and get to work, I'm not paying for your house and meals anymore"? Or are productive people expected to foot the bill for them forever, even in a fantasy scenario?
Also it does nothing to social, cultural and symbolic inheritance, so rich heir will probably still be rich at the end of the day, but at least they would have to work for it.
There are many solutions to getting out of it, but being homeless is starting with the least bit of opportunity possible.
The moral grandstand we all have, is enough drive for some people to build homeless shelters, provide food and shelter as well as provide programs to help the homeless get jobs.
I am allowed to be abhor a particular idea, without offering a solution to it.