Suppose you're living in LA or NYC, and you lose your job, get evicted (takes a few months and you can't land on your feet by then) and then move all your stuff to a shopping cart and start sleeping under a bridge?
I'm sure this has happened, but if I were in that situation I would begin by moving out of one of the most expensive neighborhoods in the world. Go to the library, find cheap cost of living and high job availability place, and get a one way bus ticket there. Literally anything is better than living on the street.
This is all to say I'm skeptical of the explanation that people living on the street are just like me except with bad luck. Temporarily, sure. A few nights crashing on someones couch or sleeping in a park or bus station. But chronically homeless people.
I think the overwhelming majority of them are not rational actors (could be induced by drug abuse, mental illness, some combination of the two). So giving them keys to a home won't really solve their problems.