Actually, this was the methodology of 18th amendment prohibition. The federal enforcers were “revenooers” who were agents of the Treasury, not specifically law enforcement. This kind of tax on illegal substances is actually rather commonplace, and can be described as a “tax trap”, a way to create a penalty situation where other lawbreaking is hard to prove. Like they got Al Capone.
I thought the case against Capone was based on tax evasion of undeclared income, not failure to purchase tax stamps on contraband.