The United States has been a nation of immigrants since the very first Pilgrim decided that the very first Native American he saw was little more than window dressing. Immigrants flooded into the New World, buoyed by hopes of unlimited resources, cheap land, religious freedom, and the eventual invention of the Big Gulp.
But how long did it take to America to become freaked out about immigration? Ten years. Yes, if the new nation of the United States were a person, they would have started being nervous about immigrants when they were young enough to think that "girls had cooties" and "they wanted to be either a princess or an astronaut when they grew up."
So what happened?
Well, in the late 1790s, the United States thought it was going to war with France. The reasons behind this war are pretty complicated in and of themselves, but, in a nutshell, France was worried about an alliance between the United States and England and started seizing American ships in response. (Source)
Not cool, France.
The ruling party at the time was the Federalists (under president John Adams), who were considered to be the rightful heirs of George Washington's legacy…despite the fact that Washington refused to declare himself a member of a party.
When you're Washington, you get to do stuff like that. The man could use a one-dollar bill as I.D.
The Federalists made an important realization: a lot of support for the Democratic-Republicans was in the form of recent immigrants. The answer was to use this tension with France to enact some laws to undercut support for the party. These were the Alien and Sedition Acts, which made it harder for immigrants to become citizens (and thus to vote), made it legal to deport immigrants with very little oversight, and made it illegal to do a lot of protesting against the government.
Thomas Jefferson and James Madison were not having it. Sure, they were against rights being undermined, but it was also political calculation on their side. Madison used to be a big fan of Federal power too, but this struck him as going too far. So Jefferson and Madison wrote the Kentucky and Virginia Resolutions (respectively).
The gist of these resolutions was that the Federal Government didn't have the power to restrict the states in any way not specifically outlined in the Constitution. They have a case for this under the 10th Amendment, which states that any powers not given to the U.S. are retained by the states or the people.
Jefferson, being Jefferson, took it further than Madison and flat-out stated that the states had the authority to nullify laws they deemed unconstitutional. That sounds like a blueprint for anarchy.
It kind of was. The long-term effect was that these resolutions were used as a legal justification for secession, which was what sparked the Civil War.
"Oops" is probably not strong enough of a word, but we'll use it anyway. Oops, Mr. Jefferson. Oops.