Comment: Your facts are wrong as is your conclusion.

The Taliban asked for EVIDENCE that Osama bin Laden was behind 9/11. That's what any country's government would do prior to extraditing someone. They also offered to try him in the country, based on any evidence that the USA would provide. These are all reasonable options, but they didn't satisfy America's lust for retaliation.

The American invasion of Afghanistan was not authorized by the United Nations Security Council. Hence it violated international law. Neither was the invasion justified by modern standards comparing similar events. Example: the UK didn't invade Ireland because of the IRA, despite a hundred years of bombings and terrorism. And finally, it wasn't justified on humanitarian grounds. Despite having absolutely nothing to do with 9/11, tens of thousands of Afghan civilians died due to the American invasion and occupation. All that over a mere terrorist group numbering in the hundreds.