The difference there is that Nazi Germany had a centralized dictator-run government and an organized army under its control. When we took them out, the war was over.
Afghanistan is quite different, in that its fighters conceal themselves among civilians, and it has no one central leader whose removal would end the conflict, but hundreds or thousands of mullah "generals", each operating a separate cell of fighters. Since the cells aren't under central control, taking out a warlord only makes a small local dent. Wiping out a cell just makes the other cells scramble and hide, and recruit more. They shield themselves with civilians in civilian housing instead of congregating on military installations and battlefields, ensuring that actions against them will end up harming innocents.
We mucked this up royally, due to Bush's refusal to even consider a Marshall-type plan. In the first few days after the initial wins in Afghanistan we might have truly had the country, but the former Commander in Chief giggled and said "Screw it; I want me some Saddam Hussein!" and let it all slip through his fingers... most importantly, allowing Bin Laden to escape, the putative reason for the Afghan war in the first place.
We've outstayed our welcome there, and there aren't going to be any freakin' hearts and minds on our side in Afghanistan now. The most reasonable thing to do there is pull out completely, wait until the triumphant terrorists form a centralized government, and then take that out all over again to cripple their hold on the country.
_________________________
Helice ~~~ (Nemo me impune lacesset.)
It is better to be a human being dissatisfied than a pig satisfied;
better to be Socrates dissatisfied than a fool satisfied.
And if the fool, or the pig, are a different opinion,
it is because they only know their own side of the question.
The other party to the comparison knows both sides.
--John Stuart Mill, UTILITARIANISM, 1863