It was not the text of some laws. It was engineering standards incorporated into certain building codes. The laws were like: "buildings shall follow ASME x.y.z" (to use a software analogy, it would be like requiring something to conform to POSIX, a standard the text of which is not freely published).
Regarding the "text of some laws", there was actually a story on HN about the city of the District of Columbia asserting copyright to their laws and making it only available via a private company:
Is this distinction interesting in some way I'm missing? If the engineering standards are mandated by law, they are effectively law themselves, so I would assert that "the text of some laws was restricted by copyright" holds. Referring to external standards was the mechanism in the cases I was thinking of, to be sure.