WWII reasons: The attack on Pearl Harbor The Germans used unrestricted submarine warfare France and the UK were allies, so sooner or later the US would have joined the war anyway
First world war reasons: German empire violated its pledge to suspend unrestricted submarine warfare in the North atlantic ocean German empire attempted to entice Mexico into an allegiance against the US and Mexico to declare war against the US The alliance to Britain also drew the US into ww1