I have spent a few years being homeless. For many people it is just a matter of bad luck. Those people will generally get back on their feet on their own. They usually just need a job.
While being homeless, I saw a lot of people that were using drugs and alcohol. They are not willing to give them up. They will stay homeless.
A third group is the mentally ill. Many of them have more resources available than the unlucky, but cannot use them effectively.
I have written one hub on the best state to live as a homeless person and I have a couple more hubs planned on this subject.