In President Obama's speech to "the Muslim world" in Cairo, he perpetuated the notion that Afghanistan was a just war while Iraq was a bad one because it was a "war of choice". Since the invasion of Iraq in 2003, this has been the term used by those who opposed the invasion to suggest that it wasn't justified or necessary.
But setting aside for now the question of which of the two wars were justified, aren't all wars wars of choice? President Bush could have chosen not to invade Afghanistan and drive out the Taliban just as he chose to invade Iraq and rid the world of one more despotic dictator. The fact that one choice may have been more evidently wise than the other is not relevant -- they were both wars of choice.
In the months preceding the invasion of Iraq, I wasn't convinced that the time was right for running Saddam out of town. The Bush administration, as well as that of Britain's then-PM Tony Blair, justified the action almost exclusively on the basis of Saddam's weapons of mass destruction program. I never doubted (and still don't) the existence of Iraq's WMD program at the time, but I also didn't doubt that, given the time allowed, Saddam had ample opportunity to erase the evidence. I gradually concluded by early 2003, though, that removing Saddam was necessary for a host of other reasons, not the least of which were his demonstrable ties to international Islamist terrorists*, even if those terrorists weren't directly connected to Osama Bin Laden and al Qaeda.
Ultimately, Iraq would have to be dealt with in the broader context of fighting and Bush appears to have asked the question "if not now, when?", to which one might add "at what cost of delay?". Bush knew he had a small window of opportunity to move against Saddam, the alternative being to leave the problem for his successor. Had Bush chosen to do so, what would his obsessive critics had to say if in the intervening years there'd been a terrorist attack on the US traced back to Saddam, or a situation forcing Barack Obama to deal with him?
* See, for example, Abu Nidal, killed in Baghdad in August 2002 by Iraqi agents, and Abu Abbas, captured by US troops in Baghdad in April 2003, right after the invasion.