Yes, I used to work with homeless people (council run hostel). The amount of people we had from prison was high. Like those from the armed forces, many were lost souls who struggled with life and were to an extent institutionalised. There was not nearly enough help for them to build and sustain a normal settled life with regular employment. Ditto for those with drug/alcohol and mental health issues. Add some of these factors together and many (men) were on a not so pleasant merry go round. Costing a lot. Prison is the tip of a social iceberg.
Of course, some people do have to detained for the safety of others, and to be accountable for their crimes. I think a lot could be done to effectively cut down on those for whom prison is a revolving door.
Really interesting to watch Parole (BBC), which shows the difficult decisions the parole board have to make. A fine balance between justified cynicism and trusting that people can (sometimes) change. Also have been watching Death Row (also BBC). Glad that we no longer go down that road. Even if sometimes I think it might be justified, in the very worst cases, I am still glad it was abolished.
Prison would need to be overhauled here, root and branch, and much better prevention and rehabilitation put in place. Even ensuring better education (so many illiterate and dyslexic prisoners) would help. This means more money and training in schools. I speak as a parent with a child with complex SEND (and someone still fighting the LA/school for any literacy provision whatsoever - DS is now 15 and has severe dyslexia) and as a dyslexia teacher.
If you are not literate how can you even fill in your Universal Credit journal or fill in a job application? For those with no support, it can mean higher odds of a descent into petty crime. We could have a smaller prison populations but we would need better safeguards against poverty and crime. Other countries have done it but I suspect it will be a long time coming in the UK, especially after 14 years of 'austerity' (well, for those who were't lining their pockets).