The law was approved amid heavy debate and protesting, with opponents citing concerns of overenforcement and a return to the war on drugs.