It is very hard to argue with the proposition that many of our lawmakers, at both the state and national levels, are chiefly animated by self-interest (often masquerading as "the public interest").
The drug laws are not didactic unless one is studying the field of corrupt legislation.
I believe it is reasonable to assert that laws proscribing drug usage are intended to instruct the general public as to what is and is not socially acceptable behavior--even if those writing the laws are often not shining exaamples of high moral character, themselves.
That might work to keep minority behavior (e.g., heroin or meth use) in the minority - but with over 40% of Americans having used pot in their lives and over 50% favoring legalization, that particular flavor of toothpaste is well out of the tube.