Afghanistan is not land that can be ruled, by anyone. Not us, not the Taliban, not the Soviet Union, not the UK... Nobody. It's ruled by various tribes in the outer region, and a small, weak, government in some of the major cities. It's a waste of time to be there now, we're trying to rebuild a nation that never existed.
Those people don't want our ideals, they want to do what they do and be left alone. You'll never be able to stop the country from harboring various groups because of the terrain... Again, it's a waste of time and money.
Also ISIS, the Taliban, and Al Qadea don't want to rule the world, they want to rule the middle East, and in the case of ISIS and Al Qadea, set up an Islamic state across traditionally Muslim lands (which includes Spain)... Obviously we can't let them take large chunks of land, and we can't negotiate with them, so the only option is to kill stop their advance and slowly suffocate them until they die. We did that to Al Qadea central, and we're doing it to ISIS. We can never kill an ideology, but we can significantly reduce their risk to us. Getting out of the Middle East is a good way to reduce risk to us, combined with other ways of course.
U.S. refuses aid from other nations because we think it makes us look weak.
Afghanistan didn't attack us, none of the hijackers came from Afghanistan. It just happened to be that Al Qaeda was there, so we went to go and get them. The original mission was nothing about nation building, the original mission was to beat back the Taliban, and the extreme sect that was Al Qaeda that was attached to them. We did that and then got involved in Iraq so we allowed them to return, which is why Afghanistan flared up again. The idea of nation building in Afghanistan came after we were doing it in Iraq and the war on terror shifted into a "install Democracy in the middle east and watch it spread" which has thus-far backfired horribly.
Again these people don't want us there, they don't want us in Iraq, they don't want us in Afghanistan, they don't want us in Syria. They want the wars to end and to go back to farming and whatever else they were doing before we decided to get involved. Mission creep freaked us in the Korean war and it's doing it again in the Middle East. We should have taken our opportunity to bail after we killed Bin Laden.