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.
You are correct. But the states have taken their lead from the federal government. Every state in the union has far overstepped it's constitutional boundaries.