Okay. It looks like the Court opinion went against states' rights...?
No. It said that states may regulate the presence (or absence, in this case) of criminal penalties against doctors, for the use of a controlled substance under the doctor's direction. The waiving of criminal penalty is conditioned on following statutory procedures.
The tougher legal inconsistency to square is this opinion v. the medical marijuana one (Raich), where SCOTUS held that the federal regulation was superior to the state one. Thomas's dissent uses that line of argument.
I haven't deconstructed either case in great detail, so take my summary analysis with a grain of salt. One bottom line buzzphrase is "illicit use." One bottom line question unsettled is who gets to decide what is licit and what is illicit.