It helps no one not the drug user who goes to prison where he can get drugs. It doesn't help the people paying for his prison time in taxes. The when he gets out he has the same problem but no one will hire him because he's been in prison so he turns to crime for money for drugs. That's ends in either overdose, life in prison or if he lucky he will have family members that can afford to get him help but he might end up with medical problems due to using drugs.
I have carried out a lot of research into this topic over the past few months and could find no evidence to suggest that punishing problem drug users for minor offences helps them or society. Sending someone to court, prison etc. costs the tax payer far more than the cost of rehabilitation and does not work. Our prisons are overcrowded and do not have the resources to treat addiction. Therefore, the cause of the offending is not addresses and the addict is likely to reoffend. I believe addiction is a disease and should be treated as one.