Or union labor. I needed some electrical work on a new house, but there's no electricians available for months. Hanging out with a contractor friend, I mentioned that the state law says "the homeowner OR a licensed electrician", and he reacted like doing it myself meant wiring the house with dead orphans or something. I've done electrical work, I just make more money in software so I'm not licensed, but that is somehow even worse because I'm depriving the union electricians of work. So now its a secret I take to my grave apparently.
The rule does make sense from a public safety point, because untrained people can do a lot of mistakes in electrical wiring. If you as the homeowner fuck it up and cause a fire, well that's on your own fault. If a licensed electrician fucks it up, their insurance pays for damages. If Joe Random fucks up their neighbor's electrical wiring, chances are high he has no insurance and now the homeowner is stuck with a burnt-down house.
Oh that new building code or electrical code just so happens to only be fulfilled by using the latest (patented) product by company X?
Well it's the state of the art, we can't build below that standard anymore.