We didn't create Al'Qaeda, and their reason for existing had nothing to do with our involvement with Afghanistan. You can easily check this for yourself by reading anything written by Osama bin Laden. Also, when the US left Iraq it was much more stable than it was pre-surge. The biggest mistake (and there were many) was leaving the region before basic Iraqi institutions were strong enough to stand on their own. It was considered a mistake by many to leave that region in the frail state it was in, but those concerns were ignored.