All nations make mistakes, wrong policies, foolish wars, prejudices, but few mistakes are such that they can not be escaped in a generation.
Vietnam was a mistake, but the American economy recovered, the blunder was eventually accepted, and although there were short incursions into other nations, it was not until 2001 the United States strode into the cesspool they had created in Afghanistan.
For thousands of years, Afghanistan has been the most backward spot on the globe. Although one can point to societies in the Amazon Basin or deep in Central Congo, no place exists that has ever been a crossroads of civilisations which has not progressed, save Afghanistan.
Alexander the Great went through Afghanistan, as he had for most of the known world. Where in other places he left libraries and cities, in Afghanistan whatever he created ceased to exist and the culture returned to its level of primativity.
Genghis Khan passed through, created a number of Khanates, but none ever developed, and Timur the Lame move through, conquering, leaving, the culture stayed as backwards as it had always been.
The British entered and after spilling a lot of blood, left, and the people continued in their day to day pre-Noah style.
Men have always had sex with boys, then discarded them. Men have always married young girls, and abused them. Education has never been important. Modern ideas have always been disdained. The only time in its history that Afghanistan almost entered civilisation was when the Russians conquered it.
For the first time there were free schools, free medical care, law, and development. Had America not armed the mujahadeen, not helped create rebels and supported them, Afghanistan might today be at the level of Uzbekistan; yes not a pinnacle of civilisation, but centuries ahead of Afghanistan.
The United States intervened, the Soviets pulled out, and the dark ages returned. The Taliban took control to make life as unpleasant as usual, and whatever progress had been made, was lost.
That al-qaeda would use Afghanistan as a base was known before 9/11, but as it is Afghanistan, who cared? The only use of that country was to grow poppies to make opium and subsequently heroin for drug dealers.
Had America left the Soviets to civilise Afghanistan there would never have been a 9/11, and there would not now be a permanent war in a place that time has forgot.