US Laws are Free of Copyright
Federal Works
17 USC 105 says:
Copyright protection under this title is not available for any work of the United States Government, but the United States Government is not precluded from receiving and holding copyrights transferred to it by assignment, bequest, or otherwise.
The phrase "work of the United States Government" has been interpreted to mean any work created by an officer or employee of the government in the course of his or her official duties. See 17 USC 101 for the official definition.
This includes the text of (any and all) legislation. The official texts of all US laws (and federal regulations) are in the public domain, and no one may claim copyright on them. Strictly speaking, this is not a matter of "fair use". Fair use is an exception for limited uses of copyrighted content. The texts of these laws are not protected by copyright at all, and never have been.
State Works
In addition, while works of the various US states are not automatically in the public domain, the text of state laws, and I believe of the various state and local regulations are also in the public domain. This Wikipedia article says:
Federal statutes are in the public domain and no copyright attaches to them. The same is true of court decisions.
In State of Georgia vs Public Resource Org, Inc 11th Circuit No. 17-11589, (October 19, 2018) a three-judge panel of the US 11th Circuit Court of Appeals wrote:
The general rule that legislative codifications are uncopyrightable derives from an understanding of the nature of law and the basic idea that the People, as the reservoir of all sovereignty, are the source of our law. For purposes of the Copyright Act, this means that the People are the constructive authors of those official legal promulgations of government that represent an exercise of sovereign authority. And because they are the authors, the People are the owners of these works, meaning that the works are intrinsically public domain material and, therefore, uncopyrightable.
The Wikipedia article linked above quotes State of Georgia v. Harrison Co, 548 F.Supp 110, 114 (N.D. Ga 1982) as saying:
The citizens are the authors of the law, and therefore its owners, regardless of who actually drafts the provisions, because the law derives its authority from the consent of the public, expressed through the democratic process.
It also quotes a US copyright office publication as saying:
As a matter of longstanding public policy, the U.S. Copyright Office will not register a government edict that has been issued by any state, local, or territorial government, including legislative enactments, judicial decisions, administrative rulings, public ordinances, or similar types of official legal materials. Likewise, the Office will not register a government edict issued by any foreign government or any translation prepared by a government employee acting within the course of his or her official duties.
However, some states do attempt to claim copyright in electronic versions of their state codes. The 2015 LA Times story "Georgia claims that publishing its state laws for free online is 'terrorism'" reports on a recent infringement suit by the State of Georgia against Carl Malamud, who makes copies of the Georgia Annotated Code available for free online. The state claimed that the annotations are protected by copyright.
In State of Georgia vs Public Resource Org, Inc 11th Circuit No. 17-11589, (October 19, 2018) a three-judge panel of the US 11th Circuit Court of Appeals found this claim to be without merit.
After a thorough review of the law, and an examination of the annotations, we conclude that no valid copyright interest can be asserted in any part of the OCGA.
...
In most states the “official” code is comprised of statutory text alone, and all agree that a state’s codification cannot be copyrighted because the authorship is ultimately attributable to the People.
...
When a legislature enacts a law, or a court writes an opinion rendering an official interpretation of the law in a case or controversy, they are undisputedly speaking on behalf of the People, who are properly regarded as the author of the work.
...
Because we conclude that no copyright can be held in the annotations, we have no occasion to address the parties’ other arguments regarding originality and fair use.
Non-US Laws
UK laws are protected under Crown Copyright, although permissive licenses for reproducing copies are easily available. Many other countries have similar provisions. The US, however, does not generally recognize such copyrights.
The position of the US Copyright Office is that:
[T]he Office will not register a government edict issued by any foreign government or any translation prepared by a government employee acting within the course of his or her official duties.
Laws Incorporating Copyrighted Works by Reference
Laws sometimes include by reference privately developed and copyrighted documents. For example, building codes and other safety codes may be developed by private groups, often national non-profit organizations, and incorporated into state laws by reference. This means that the text of the privately developed code is legally part of the law, and the law cannot be fully understood and complied with without reading the code. But the code is a copyrighted work, and the copyright holder may charge for copies.
For example, this official Texas web page says:
The Texas statutes, administrative rules, and local ordinances occasionally adopt, incorporate, or refer to technical codes published by independent organizations. These codes describe scientific and safety standards for structures and discuss specifications for fire safety, electrical systems, plumbing fixtures, construction practices, and many other topics.
...
Codes are not reprinted within the statutes or the local ordinances themselves. They are "adopted by reference" or "incorporated by reference" and are usually available to review at the city clerk's office and at some public libraries. Please contact your local public library or your local government for assistance accessing codes not available online.
Federal Copyrights
However, this does not mean that anything "published by the US government" is in the public domain or is free of copyright. The Federal government often hires contractors to prepare various works. These works are protected by copyright. Frequently, the contracts will assign this copyright to the Federal government, which as 17 USC 105 says:
... is not precluded from receiving and holding copyrights transferred to it by assignment, bequest, or otherwise.
Such works are therefore copyrighted, and the copyright holder is or may be the US Federal Government. They are protected in the same way and to the same degree as works of private authorship. Many works funded by the US Federal Government fall into this category.