The Hayes Code exists to have a standardized industry guideline in response to individual states issuing dozens of differing film censorship bills. So while it is not a law, it is a guideline for how to be compliant with a rapidly proliferating number of censorship laws.