When I was a magistrate we dealt with a lot of addicts (to both legal and illegal substances) and I had to read a lot of pre-sentence probation reports. These would give a "potted history" of the offender's background. In my experience housing (or, more precisely, the lack of) and bereavement...
A good start would be to treat drug addiction as a health problem, rather than a criminal one.
No-one wakes up and says "Right then, I think I'll become a heroin addict", it's usually a spiral down from other drugs.
We (society) need to have a grown up discussion around the legalisation of all...