Governments are not by and large incompetent, nor are they responsible for craft commonly-used electrical wiring standards. That is, in fact, written by a private organization: https://en.wikipedia.org/wiki/National_Electrical_Code
Local governments (the ones in charge of zoning) adopt this because it's easier to adopt an existing standard than to try and write one's own. Any homeowner who's discovered wonky wiring done by a previous handyman will appreciate the existence of standards like this.
So many people argue against regulations, not realizing how much absolute shit they'd be up against now without them. People being electrocuted by their homes used to be a routine thing, for example.
It's like how we have anti-vaxxers now that the memories of what the vaccines cure are so distant.
Local governments (the ones in charge of zoning) adopt this because it's easier to adopt an existing standard than to try and write one's own. Any homeowner who's discovered wonky wiring done by a previous handyman will appreciate the existence of standards like this.