I kind of read the suggestion as a deterrent for dealers and people engaged in drug trafficking, which could lead to less addicts... Not as "jail the junkies!"
And? Doctors are not supposed to be a pharma dispensary. Depending on motivational factors a doctor may either tell someone to suck it up, quickly fill out a standard subscription to cover up the symptoms or spends some time to diagnose and fix the root cause and then prescribe medication by taking into account but the patients immediate needs and the long-term health impacts.