The government has stood the Constitution on it's head since the Roosevelt began literally dozens of unconstitutional government programs buy invoking the "interstate commerce clause" and pretending that it was written to basically void the rest of the Constitution by giving Congress the power to do literally ANYTHING that is even remotely linked to interstate commerce.
These are state laws, so the commerce clause (and federal power) is not implicated.
That said, these are stupid laws for an altogether different reason.
I am no fan of drug legalization, but restrictions on the sale of pseudoephedrine or ephedrine may eliminate Bubba, and lay the groundwork for 21st Century goombahs.