During covid in Australia, we just put the homeless in hotels. It didn't cost much in comparison to the other government spending around that time and homelessness was largely eliminated. Then we got over the pandemic and tossed people out onto the street. Homelessness for some is a choice by society. Especially in the west.
Lots of "solutions" to homelessness are possible if you're willing to take away their rights, which is what happened to them (and many others) during the pandemic.
Failing to appreciate egoistic cooperation is a peculiar mainstay of our culture. Both the fixed ideas of cooperation for the greater good, and radical self-reliance are put on a pedestal, and often pursued to the point of irrationality.