The war in Afghanistan was a reaction on 9/11, an act to get a small group of people called Al-Qaeda - - attacking a whole country because of a group of people is a revenge act. The war on Iraq was based on false premises (weapons of mass destruction), was not with the support from U.N. Iraq ranks as the third in the world in oil supplies - - Iraq's oil is one of the first things that invasive army protected and one of the only things that will be protected in the future as the invasive army moves out.
One can say the US wanted to protect the "people" and it's classy, but there are other places that need a lot more help (like Congo, where over 5.4 million people have died in/because of war since 1998).