BTW, the US had no treaty of alliances in World War I. There was no legal justification for the US to enter World War I. Our reasons to enter World War I were remarkably similar for our reasons for declaring war on the UK.
If you think World War I was a "just war" then one must assume that you must be in favor of US action in Iraq.
Rather than say "had to" or "chose to" I'll use a sliding scale:
10 = had to
1 = war of choice
War of 1812: 3
Mexican/American War: 4 (I give it slightly higher because we wanted their land - i.e. it was slightly more in our interest)
Civil War: 10
Spanish-American war: 1
World War I: 3
World War II: 9 (Germany declared war on the US after Japan attacked)
Korean War: 5
Vietnam war: 4
Panama: 7 (Noriega declared war on US, Panama Canal security vital US interest)
First Gulf War: 8 (Kuwait was a friend of the US, unless you're biking to work, oil is a key strategic resource)
Kosovo: 1 (what the hell was that about?)
Second Gulf War: 4