So I'm saying that it in many cases, the problem isn't so much that prison is a failure as a rehabilitation center and we should focus on rehabilitation elsewhere, it's that people are in prison for things they simply don't want to be rehabilitated for and have strong influences to continue doing. The culture is inherently resistant to being rehabilitated from things that it doesn't consider harmful.
To use an example that might be more neutral, what if copyright enforcement was more severe and we had half a million people in prison for watching unlicensed YouTube videos? We might analyze the failure of the prison system in rehabilitating people from watching the wrong streams and focus more on education so that people could identify properly licened content before they watched it. But unless the people actually considered this behavior harmful, it would be an impossible task, and we would see ever increasing numbers of people in prison for watching the wrong videos.
But we also have very high recidivism rates for stuff like "armed robbery", independent of social-issue crimes like marijuana possession. And society generally has an Opinion about armed robbery. (It's bad!)
People don't commit violent crimes for weed. The crime is having weed. And things that are not weed are not being legalized state-by-state.