I blame cops when they enforce a stupid law, and I blame politicians when they pass stupid laws. Given the huge number of inappropriate laws, there is plenty of blame for everyone.
This scenario is ridiculous, but I’m not sure I’d reflectively call this a stupid law. I don’t think we’d be referring to this as a “stupid law” if it was being used to shut down some dude from the Middle East who was selling roasted goat in his front yard.