The United States entered the war because of the Germans' decision to resume the policy of unrestricted submarine warfare, and the so-called "Zimmerman telegram," intercepted by the British, in which Germany floated the idea of an alliance with Mexico.
The Zimmerman telegraph was about to get sent to Mexico and it was intercepted by Britain. They wanted to propose a military alliance between Mexico and Germany.