I have been homeless 5 years ago because of a failed marriage. I can tell you the last place I would have wanted to end up was prison, think I would rather have died.
I still had a business but it was failing at that point not giving me a good enough credit rating to rent privately. I got a room for awhile but then I was struggling to pay the rent on that as clients were delaying payments more and more.
I then went on to sofa surfing at friends with the odd night sleeping in my car. The odd night soon turns into more nights as I worried I was intruding more and more on people. I read that sofa surfing is not always classed as homeless with some councils so the official homeless figures are fudged.
Then my health failed which finished off what was left of my work and I ended up in hospital. My lifestyle had caused a stomach ulcer that ruptured which I apparently was lucky to survive from.
However the ulcer then became my stroke of luck in a strange kind of way. They wouldn't discharge me so the council had to step in and house me. After a few months I was back on my feet working and trying to get my life back.
It was the most horrible, soul destroying thing not having a roof over your head. You can feel everything slipping. Your health, your appearance and your mental well being. If you get sick you can't see a doctor as you can't have a GP without an address.
The times I contemplated ending my life during that time I couldn't count. I was probably too coward to do it. The worse thing was the humiliation of it all, going from being a very independent person to someone begging for help.
It certainly has changed me, some for the better and some for the worse. I have far more compassion for people who find themselves out of work or worse. I now spend a few evenings working for food banks and delivery food to people who need help, some of them are homeless as well.
The downside is I use to be a patient, caring passive person. I would have done anything to avoid confrontation but that has changed. I have changed to not take any rubbish of anyone and will not back down, I would have been calm and collective and normally talked people down. This has almost ended up in violence more than once.
Before this I would have never have thought this could have happened to me. I had a wife, we had 2 businesses, a young son and a family. It can happen to more people than you think, the most loyal friends and family can only help for so long leaving you alone.
To get back to the OP. Homeless doesn't only mean sleeping rough, it is a spiral that leads to it. People sleeping rough is only the tip of the real homeless problem. If all the real homeless committed crime the prisons would probably collapse.