The US was being provocked by Germany, as German naval forces and submarines had destroyed several US merchant vessels.
Before determing the participation of the US in WWI, President Wilson sent two written warnings to Germany, explicitly posing that the relations between the two countries were at a very delicate situation. Wilson wished to remain neutral in the conflict, but he knew that it would not be possible if German attacks continued. This is why he chose to use these warnings as a manner of giving a last opportunity to Germany before performing a direct intervention.