Because Germany kept taking provocative actions towards the United States. One example of this is when a German U-boat sank the Lusitania. While yes, the Lusitania was a British ship, (and Britain was at war with Germany at the time) there was over 100 Americans on board the Lusitania. As you can imagine, Americans back at home we're not happy about this. However, the final straw was when Germany attempted to send a telegraph to Mexico. Germany tried to tell Mexico if they joined the war as a German ally, they would help Mexico reconquer their lost territories, such as California and Texas. The British intercepted the German telegraph and sent it to the U.S. instead. The United States was furious and proceeded to declare war on Germany.