How does the reason as to why America got into WWII differ from our most recent wars?

The primary reason why America got into WWII was to oppose the aggression of Nazi Germany and its allies, who had invaded and occupied much of Europe. In contrast, the most recent wars in which the United States has been involved, such as the wars in Iraq and Afghanistan, have been largely motivated by the desire to promote democracy and stability in the region, as well as to combat terrorism.