Recent court case
https://www.republicreport.org/2023/federal-appeals-couraffirms-the-right-to-publish-the-law/
One issue I have had in the past is having an electrical project that requires a city permit and must adhere to the city code and not being able to easily find the code.
In both my previous town in eastern Iowa and my current location in Des Moines the city code says something to the effect, “The city code of …. shall be the 20XX Revision of the NEC with the following adaptations.”
They list the adaptations, but not the NEC.
Until the last revision the National Fire Protection Association, the authors of the NEC and other building codes, denied free access to the codes. They sold the code books or online acces for $$, a lot of $$. So, the city would require you to follow the code, but not allow you access to read the code.
Our public library had one copy in the reference section, often in use. Anyone using the NEC infrequently knows with all the cross referencing finding what you need could take a long time. Our library had a sign up sheet for its use.
The court ruled since it is used in city law, the printing of the code (edit: by a third party- in this case public.resource.org) is fair use and can not be a basis of copyright infringement.