Iraq was to fight the "War on terror"
Afghanistan was a response to the attacks on 9/11 with the ultimate goal to capture/kill osama bin laden(which we still haven't done)
I hate when people think that both are for the same reason. Iraq was a response to some stuff that occurred int he 70s and 80s, and with the attacks on 9/11, Bush decided it would be a good idea to take care of the weapons of mass destruction that he thought Iraq still had. Back in the 70s and 80s, The leaders of iraq made and tested many weapons of mass destruction, including gases like mustard gas, tabun, botulin toxin and mycotoxin(wikipedia) They also apparently got close to nuclear weapons.
In the late 80s and early 90s, the UN told Iraq to dismantle and destroy these weapons. Iraq complied. The issue was bush didn't think they did comply, and that they continued to produce weapons(which wasn't true)
I never fully supported Iraq, but i will continue to support Afghanistan. Mainly because most of the people that live there still support osama bin laden.