You can address the problem by sentencing someone for treatment instead of jail.  That should always be the first step addressed in court.  I doubt the cost of treating addictions could be any higher than what we currently spend on not treating addictions.