In January 1917, Germany launched an “unrestricted” campaign of submarine warfare that sank American ships along with all the others. In February 1917, the British gave Wilson the text of the “Zimmerman Telegram.” In March 1917, the Russian people revolted against their disastrously incompetent government and began a march toward democracy. On 2 April 1917 Wilson asked Congress for a declaration of war. In a few days he got it.
The vote on war won bipartisan support, but many people opposed the war. Socialists and the Wobblies saw the war as a rig-up intended to get the working people of the world to kill each other for the benefit of the bosses. Some liberals also saw American participation in the war as a fool’s errand. After the declaration of war, they opposed the war by resisting the draft, or by criticizing participation in the war or of the management of the war effort.
The Wilson administration took a hard line. On the eve of joining the war, the Department of Justice approved a semi-official American Protective League to assist with the hunt for dissidents. The Espionage Act (June 1917) and Sedition Act (May 1918) provided the means to convict Socialist leaders Victor Berger and Eugene Debs, anarchists Emma Goldman and Alexander Berkman, Jehovah’s Witness Joseph Rutherford, and hundreds of lesser lights. In September 1917, government agents seized the records in many IWW offices. More than a hundred Wobbly leaders stood trial in 1918.
However, the worst of the repression took place after the war. In part, this extremism sprang from rapidly changing circumstances. In November 1917, the Bolsheviks, an extremist faction of the Russian Socialists, seized power in St. Petersburg and opened a war against all other parties in pursuit of a revolutionary dictatorship. Soon, bloody stories of the revolution alarmed or inspired people in the West. Bolsheviks grabbed violently at power in postwar Germany, Hungary, and Italy.
Far less abstract than foreign revolution, unrest at home seemed to foreshadow revolution. Labor troubles ran from a general strike in Seattle through a huge steel strike to a police strike in Boston. A small group of immigrant Italian anarchists had been waging a growing bombing campaign since 1914. It had peaked in an attack on a “Preparedness Day” parade in San Francisco in July 1916 that killed ten people. After a pause in early 1917, the bombing campaign took off again in November 1917. It ran in full spate from late 1918 to September 1920, when a bomb killed 38 people on Wall Street.
The official response was moderate, even if the political language was not. In October 1918, Congress passed an Immigration law that made it easier to deport undesirables. The governor of Massachusetts fired the striking policemen. In November 1919 and January 1920, the Attorney General A. Mitchell Palmer launched raids that arrested thousands, although many of those were soon released. About 250 people were deported on the so-called “Red Ark” in December 1919. The unofficial response was more violent. The Wobblies, for example, suffered repeated violence at the hands of vigilantes that left some of their leaders dead
Does a free society have a right to defend itself against a violent minority?
 See Barbara Tuchman, The Zimmerman Telegram (1958). You can still find it in used book-stores.
 See, for example, James McKeen Cattell – Wikipedia