We're in Afghanistan as part of the broader plan to create a pro-Western Middle East with the Israelis and Saudi Arabians, and the main aim of that plan is to destabilize and remove the counter to that, the Syrian-Iranian axis. Hence, we're in Afghanistan, which borders Iran and will allow the West to step up pressure on Tehran.
Of course, the even greater angle - U.S.-Chinese relations - is paramount as well. China has lent some degree of support to the Syrian-Iranian axis (exercising veto against condemnation of Syrian regime, offering to buy Iranian oil freed up by the EU embargo), and so not only does the battle for the Middle East become important in terms of U.S.-Chinese relations, Afghanistan itself does border China and is near the tendentious Tibet region.
Afghanistan wasn't about oil companies (per se), wasn't about humanitarianism, wasn't even really about democracy (imposing Western sociopolitical infrastructure as a means to create a pro-Western state in the territory of Afghanistan) - it's always been about the greater aim of winning the geopolitical cold war for the Middle East against China and against the enemies of the pro-Western power bloc emerging in the Middle East.
*note: discussion of Israel and Saudi Arabia both being pro-West is not to suggest direct diplomatic relations between the two, as they don't officially have relations, let alone an alliance - but rather, Saudi Arabia and Israel are both close allies of the United States, and the three of them are working to create a pro-West Middle East.