It’s not deterrence, that’s not the point. Deterrence does not work.
It’s about sending people to prison so they can do cheap labor. It’s also about racism because it’s disproportionately targeted towards minorities. It absolutely makes sense in that light.
I’m sure that is the motivation of some, those involved, but the vast majority will be voters who think deterrence works.
It’s the prison-industrial complex paying the politicians to push this stuff through. Voters don’t matter to the politics being pushed, they just get told later that they wanted them.
Policy at a macro scale is very different than policy at a citizen level. While both inform the other many decisions are made on either side without understanding consequences. Banning drug use at a home or even a town level could make sense and work in the head of household’s favor but that one town or house banning the use could make things worse for another, but from the smaller level makes a ton of sense, unfortunately.