In SF they _do_ provide housing to homeless people. The homeless people, largely addicted to illegal drugs, use the housing to store most their possessions and occasionally come in to change clothes and bathe, but continue living in tents, or otherwise existing strung out on the sidewalks.
Why? Because they're not permitted to use illegal drugs in the provided housing facilities, they will lose the housing. These "houseless" people basically have two homes, the streets are their summer home where they get high and continue to be a nuisance. The provided housing goes mostly unoccupied in these instances. Having written that, maybe the analogy works better in reverse - the public housing is the unoccupied summer home? Either way, it's totally not being used as intended because of the restrictions placed on the housing.
Also consider shelters generally banned weapons and are dens of communicable disease and bed bugs (I'm horribly allergic to them so I'll never step inside a shelter).
When I was homeless I lived outside because if you have a decent tent and sleeping bag it's perfectly comfortable, and I like to have a weapon handy no matter what and I reject any living circumstance that would prohibit that. At no point did drugs enter the equation, but if they did, it wouldn't have changed the calculus.