At the time, the US was not heavily involved in old world European politics, and had little to gain militarily from joining a side in the war. In addition, it was an exceptionally sanguinary conflict when the US entered late, and there was no particular reason, moral, political or otherwise, why the US would join one side versus the other. So why did the US enter WWI?
A complete answer to this question will necessarily have two parts: an analysis of an underlying cause as well as the identification of a triggering cause. The answers to what the underlying and triggering cause will be in this case will depend to a large extent on the theoretical leanings of the historian telling the story.
The eminent theorist of International Relations John Mearsheimer, of the University of Chicago, argues in his 2001 book The Tragedy of Great Power Politics that the underlying cause of America's entry into WWI was the desire of President Wilson to prevent Germany from establishing a state of hegemony in Europe (hegemony is a situation where local great powers cannot militarily contain a greater power, known as a superpower). The United States spent over a century establishing hegemony in the Americas and supporting efforts to push European powers out of the Western Hemisphere so that it could ensure its own security by being surrounded by relatively weak neighbors. As Mearsheimer explains it, from 1850 until 1900 the United States gave hardly any thought to sending troops to fight in any European wars since it was clear that the balance of powers was very even and that an alliance of local great powers could contain any of their peers who tried to establish hegemony on the continent. The United States adopted a policy of "buck passing" -- in other words, relying on other states to accomplish its strategic objectives for it -- during this period (Mearsheimer, 252-253).
From 1900 to 1917 it became increasingly apparent that Germany was the most powerful state in the region and had a realistic chance of establishing hegemony in Europe (252). After war broke out in 1914, the United States relied on the Triple Entente nations of France, Russia, and the United Kingdom to contain Germany on it's behalf. Before 1917 the United States did not commit ground troops to the War but did provide the UK and France with substantial military and financial assistance, still in line with the buck passing strategy that it had relied on for decades (Ibid).
Events in Russia played a decisive role in triggering American entry into the conflict. During the War, Russia played a critical role in preventing a decisive German victory by providing an Eastern Front to the War. The Russian army, however, was repeatedly beaten badly by the Germans and the war became steadily more and more unpopular with the Russian public. By March of 1917, it was clear that the Russian army was on the verge of disintegration, and a revolution in March of that year (February under the old style Russian calendar) removed the Tsar from power. Given Russia's military weakness and internal political instability, it now appeared that the Eastern Front might close, allowing Germany to concentrate it's energy on the Western Front and a serious possibility at a decisive victory (Mearsheimer, 254). The United States could no longer pass the buck to other nations, and consequently entered the war in April of 1917 in order to prevent a decisive German victory.
To make a long story short, the underlying cause of America's entry into the war was fear of German hegemony in Europe, and the ultimate triggering cause was Russia's internal political instability.