Vietnam never wanted to be American. Afghanistan certainly never wanted to be American.
Afghanistan is a theocracy older than Islam. We may have pushed this theocracy back out of sight for a couple a decades, but it was always there waiting to step back out into the light.
The problem with the United States is, we have lost sight of what winning a war is all about. We do "controlled wars", or "police actions".
A proper, serious war, is not about beating a group of people into submission, and then rebuilding their house. You annihilate the inhabitants and claim what's left as your own.