The Bush administration and media were able to link the World Trade Center attack to Afghanistan quite easily. It gave people the feeling that if they protested the war, they would have been supporting the attack on the World Trade Center. Only months later there were massive protests about the Iraq war. Saddam Hussein had secretly done what Iran and other nations are talking about doing quite openly now, trading oil in a currency other than the dollar, and dodging US sanctions. It is the same thing Gaddafi did.
But the war in Afghanistan was still a huge mistake. Ironically, the USSR collapsed after a war with Afghanistan that continued too long for them to win and too long for them to continue fighting. It looks like the same thing is happening to the US. It looks like the weak and insignificant Afghanistan will be credited with defeating, or contributing to the defeat of, both of the former world super powers.