There are lots of meds that can’t be delivered by mail. Any controlled substances for example.
This seems necessary when the penalty for being caught after the fact is insufficient to stop people from doing it. Either because penalties don’t work in preventing behavior, or because current society has difficulty implementing sufficiently harsh penalties because it feels too mean.