tbh that's quite a naive way to look at it.
Although it's just one example, a few years back I watched a tv prog about homeless people. Long story short, I think it was three (white British) people who were housed by the council. Freshly decorated apartments/flats.
Two of the three ended up back on the streets x weeks later. One of them admitting they 'missed life on the street', couldn't take to being confined by four walls and wanted back to their mates. Ok on some level you can understand their logic, sort of 'street institutionalised.' The other had been moved to a place a few miles from their home town and missed their family/friends.
As I say, just one example, however it's not as straightforward as saying 'why aren't we housing all the homeless?!?' Multi-faceted issue.
It's a bit like the lump of labour fallacy.