Maybe it's righteous indignation, or maybe they don't know your friend isn't an undercover cop.
Weed on the other hand is very strictly enforced for the most part, except in more touristy and "Americanized" places.
https://en.wikipedia.org/wiki/Single_Convention_on_Narcotic_...
Seems to be the convention that brought cannabis into the fold.
Usually police will turn a blind eye both for selling pot and selling beer, unless anything goes wrong and somebody complains.