Yes. Years ago. The last five or so have been to establish a "US friendly" government there, which has been mostly a waste of time, money, men and material. At best we have an entity that is little better than what we have relations-wise with Pakistan, and we've recently all seen how that really works.
Iran is a problem, and is probably sooner than later going to be a big problem, and wasting our blood and treasure trying to fix failed states weakens us for those battles to come.
The death of Bin Laden — a marquee objective in the War on Terror — was not accomplished until a few months ago. As for our other objectives and efforts in Afghanistan, it is worth keeping in mind that we are still in medias res and cannot know how things will appear a generation from now.