I'll never understand the logic behind this. How come cancer patients or people recovering from surgery with powerful opiates aren't thrown in prison? Why is possessing a chemical used medically a crime? (This is mostly rhetorical, but still sad.)
Meanwhile another suburban soccer mom/dad doctor-shops and snags another prescription for fully legal, powerful opiates. He/she eventually overdoses and dies. Nothing is done.
If you're asking about the logic behind the law, don't. Looking for logic in politics is a fast way to the crazy house.