The UIGEA (Unlawful Internet Gambling Enforcement Act) was passed in November of 2006, as part of the SAFE Port Act [0], which placed online poker into a legal grey area for most U.S. citizens. A lot of major poker sites withdrew from the U.S. market as a result.
The legality of both in-person and online poker varies from state to state.
[0]: https://www.beatthefish.com/us-poker-sites/uigea-unlawful-in...