There are lots of reasons: the break-up of a marriage or relationship; the loss of a job leading to the repossession of a home or inability to pay the rent; an addiction or abuse of drugs, either prescribed or illegal; alcohol or even gambling.
People may become homeless because of a mental illness, although as with drug or alcohol abuse, some people become unwell or develop a problem because they have become homeless. People who have served in the armed forces often find it impossible to cope with civilian life. Others may be running away from an abusive relationship.
It could happen to any one of us.
source
(and the ibill thing, that could make you homeless too)