Iraq actually became a great trap to attack and kill terrorists. AL Queda sent their best in to go after us, and we killed an awful lot of them. Much easier battle field for us than the Afghanistan terrain.
I can second guess tactics in both Afghanistan and Iraq, but not the mission for each.
I think our soldiers there did a heroic job in a bad situation. I just believe that Iraq made it a lot easier for the terrorists to kill and wear down America like they had done to the USSR a generation earlier. And the removal of Saddam created a huge void of instability not to the benefit of the US.
The issue is that the other side isn’t stupid. The “fly paper” strategy worked for a while, till the other side realized that there are tons of targets in the mainland USA.