You're being more than a little disingenuous ignoring the fact that we invaded Afghanistan specifically to go after the extremist group that was responsible for 9/11 about 2yr prior to invading Iraq, which was done for different reasons and "harboring terrorists" took a back seat to WMDs on that list of reasons.
There is a memo from Rumsfeld around then. [1]
The fact that all the terrorists were Saudi, that Bin Laden was Saudi, that Iraq was an enemy of the Saud regime, that Iraq was a "buffer" between the rest of the Middle East and Iran, all of that was ignored.
The war in Iraq was the US worst foreign affairs decision in the last 50 years.
All of the "WMD" and then "bringing democracy" was retconning the original desire to finish the first Iraq war, which had nothing to do with 9/11.
[1] https://www.cbsnews.com/news/plans-for-iraq-attack-began-on-...
When I first seen 9/11 on TV as an 11 year old, I instantly thought that Ryadh will be turned into a crater within a few hours.
I dropped my jaw out of suprise, when I heard US going to declare war on Iraq — Saudis' biggest enemy. It made zero sense. I kept on watching the satellite TV at my neighbour's house, and was hoping that it was my knowledge of English failing me. It didn't.