I think you are missing the proverbial forest for the trees.

As to Vietnam, the whole construct of "North" and "South" states was a fiction created by the US, so I sadly love the irony of the fact that we view the conflict through the lens of our own fantasy. It was a 30 year resistance against foreign occupation and revolution against the "legal" but illegitimate governments and entities created and protected by those occupiers. Insurgency ebbs and flows, and this was an independence movement from start to finish. Our meddling merely delayed the inevitable and brought an extra generation of hardship to the people of that region.

Was de-Ba'athification a tactical error? Yes. All Iraq needed was a punitive expedition at most. But instead we removed the government, stayed, and put in and sought to protect one of our liking. Strategically that creates presumptive resistance warfare against the occupier, and presumptive revolutionary illegal democracy against the puppet regime. Better tactics would not have prevented the inevitable strategic results of our actions.

As to Afghanistan? A true state whether it meets our standard for that or not. We love to call things "failed" that don't look like what we think right is. As a patronage society where there is "winner" or "loser" and little in between, there is always competition to be the winner. Those who had patronage power under the Taliban will always (rightfully) believe that " but for" the meddling of the US they would still be in power - so there will always be revolutionary illegal democracy against the government we created and protect; and always resistance warfare against our presence to do so.

This is human nature, and we are not exempt because we rationalize good intentions, and believe ourselves to be "exceptional."