Firstly, US President Wilson was an idealist; he believed that if Germany won WW1, this would be a "bad thing" not just for USA, but for the whole world. The best way to prevent this was to join the war on the Allied side.
Secondly,from January 1917 Germany began unrestricted submarine warfare. US merchant ships were being sunk, and US seamen being killed,even though USA was neutral. Other neutral ships sailing to and from America were also being sunk, and were becoming reluctant to sail to and from USA. All this was having a detrimental effect on the US economy, and the best way to stop it was to join the war on the Allied side, and help win the war quickly.
Next,also in January 1917, Germany had sent the Zimmerman Telegram to the Mexican government.This promised "substantial aid" in regaining territory lost to USA in the Mexican-American War of 1846-1848 if Mexico attacked the US. So, Germany had now become a direct threat to US territory, and the best way to remove this threat was to join the war on the Allied side and make sure Germany was defeated.
Finally, the US had lent the Allies a lot of money by 1917 for the war. If the Allies lost, the prospect of USA getting any of this money repaid any time soon was slim to none (and slim would be out of town for some time). The best way to ensure these loans would be repaid was to join the war on the Allied side, and help make sure they won the war.