Plumbing codes are regulatory standards designed to ensure the safety, health, and efficiency of plumbing systems in buildings. They dictate the materials, installation methods, and maintenance requirements necessary to prevent hazards like leaks, contamination, and structural damage.