It's strange, isn't it? Wizards seem to have a fairly lax attitude towards love potions, even when they acknowledge that love potions can be dangerous. Is it because the effects aren't "real"?
Anyway, as I understand it... Amortentia isn't illegal, but giving someone a potion without their consent or knowledge is. Mr. Elmasry seemed to be taking great care to make sure no one walked off with a sample.