After 9/11, the US demanded that the Taliban hand over Osama bin Laden. If the Taliban complied, then the matter could have ended there. The Taliban could have gone on being petty tyrants in the absolute worst part of the world, and the American could have gone on paying attention to celebrity gossip instead of world events.
We were under the impression that the purpose of the Afghan invasion was to capture or kill a particular mass murderer. The mission could have been called a success three years ago if that were the sole objective. But somehow our government got distracted.
We cannot use our military to build democracy in other people's countries anymore than we can renovate our neighbor's house with a shotgun. The good people of Afghanistan (and the bad people as well) have to decide for themselves that they want a modern country.