Addiction is not magically fixed by prison and/or rehab. Even with a holistic approach of social support, medical treatment and mental healthcare, addiction has such a hold that rehabilitation hovers around 15% effectiveness. There's no easy fix, and it's almost impossible to stem the flow from the supply side. Your proposed solution would result in a very expensive revolving door, imo.