It would be fine if the installer was the only one in jeopardy for a faulty installation. That’s just not always the case. In not even usually the case.
Civil building codes are okay with me, along with the FDA and Department of Agriculture, Osha .... et al.
Here is an example of why: http://sdinspect.com/health-and-safety/water-heater-danger/
Having codes on seemingly easy things like Hot Water heater installations is low hanging fruit for opposition. It’s easy to convince others it’s stupid, unnecessary and an intrusion.
The problem arises when codes are applied nonsensically or misused as a tool of oppression over ones political enemies.
Everyone has their positions on how much freedom infringement they tolerate ranging from living in a total police state to one of complete anarchy. Debate usually centers around where to draw the line between the two.