Answer :
There were two things, actually:
- Britain intercepted the Zimmerman Telegram
- Germany resumed unrestricted submarine warfare
Context/detail:
Public outrage in the US against the Germans swept the nation following the sinking of the British ocean liner, Lusitania -- but that happened before 1917. When a German U-boat (submarine) sank the Lusitania in May, 1915, over 1,000 persons were killed, including more than 100 Americans. The passenger liner was targeted by the Germans because they suspected weapons were being shipped to Britain in the cargo hold of the ship.
Germany managed to stave off American entry into the war at the time by pledging to stop submarine attacks. But a couple years later they resumed such attacks, and there was also an intercepted telegram (the "Zimmerman Telegram") that showed Germany was trying to secure Mexico as an ally against the United States.
In 1917, the US declared war on Germany in response.