Brad Plumer, Mike Scheuer, and others have been casting doubt on the decision to invade Afghanistan lately. But Rob Farley's article retroactively arguing the case for war seems more convincing, and brings up a point too rarely mentioned:
Probably the biggest reason for the post-war problems plaguing Operation Enduring Freedom has been the war in Iraq. Even before the invasion there, the Bush administration began directing resources away from Afghanistan toward the Persian Gulf. The resultant invasion not only taxed the nation-building resources of the United States, but helped shatter the post-9/11 consensus on Afghanistan in Europe. On its own, the invasion of Afghanistan could be understood as a necessary, even noble response to a clear attack on the United States. In conjunction with the invasion of Iraq, the occupation of Afghanistan took on a more sinister tone, looking more like one component in a wider imperial project than a regrettable and unusual necessity.
Although we can't say for sure, I also suspect that the invasion of Iraq has increased material and popular support for what's left of al-Qaeda, which has worked to strengthen the hand of the rump Taliban in rural Afghanistan and Pakistan. Much of the question of incompetence turns, therefore, on whether or not the invasion of Iraq was predictable in November 2001. Had evidence of Dick Cheney and Donald Rumsfeld's obsession with Iraq been available at that point, it could reasonably have been predicted that Operation Enduring Freedom would likely suffer. Most of that evidence, however, didn't turn up until later, making it harder to argue that the incompetence of the administration was manifest before Afghan invasion.
Finally, the international situation was favorable. The invasion of Afghanistan was widely popular in both the United States and Europe. Although the United States initially rejected direct NATO involvement in Operation Enduring Freedom (a decision that was probably correct, given how quickly U.S. and Northern Alliance forces rolled up the Taliban) it was always expected that NATO forces would participate in the occupation and reconstruction of Afghanistan. The United States also secured the cooperation of neighboring states at an early date. Pakistan acquiesced in the invasion after pressure from the United States and Russia, while Uzbekistan and Iran both cooperated fully. Iranian assistance in the western provinces was critical in the early days of the occupation -- and this cooperation might have provided the foundation for long term accommodation between Iran and the United States.
There was an alternative response to 9/11 that the war in Afghanistan could have proved the foundation of. One predicated on consensus, not division; on widely-understood goals rather than narrowly conceived interests. As Rob writes, Europe believed in that war, in our righteousness for pursuing it, and in its underlying premise: That terrorists must be hunted down and killed. The unanimity of support scared our enemies, bringing Pakistan into the fold and spurring Iran to approach us for a grand bargain.
But we rejected Iran's entreaties, figuring we needn't negotiate from a position of such strength. We demolished the NATO consensus on our mission by widening the scope to include the manifestly unconnected Iraq War. We tossed away the goodwill, the willingness to compromise, the sense of shared mission, that existed beforehand. And we did it all...for what? For this war in Iraq, which has distracted us from Afghanistan, pummeled us for years, exposed the limits of our power and the contours of our weaknesses, and degraded our international standing so countries like Iran no longer believe they need to accommodate our demands. Afghanistan could've been used to build a better world order. Instead it was used to destroy Iraq. The picture in the rearview mirror is ugly.
Update: Iran's overtures, I'm reminded, where in the Spring of 2003, so after we'd entered Iraq. The groundwork, as Gareth Porter explains in his definitive article on the subject, was laid by the cooperation during the Afghanistan conflict (which the Bushies declined to use to open negotiations towards Iran), but the actual overture was nevertheless a few months after we invaded Iraq.