Standard explanation has been that the Pakistani ISI had many important operatives within the Taliban at the time and needed to get them out. However, so the story goes, the situation got out of hand and important senior Taliban figures were mistakenly allowed to escape as well. Michel Chossudovsky implies in this article from the Centre for Research on Globalization ( www.globalresearch.ca ) that it was more than just a giant clusterf*ck as we've been led to believe, it was to ensure the war on terror was kept alive.
Here's a brief excerpt where he quotes a Seymour Hersh article:
"Musharraf won American support for the airlift by warning that the humiliation of losing hundreds-and perhaps thousands-of Pakistani Army men and intelligence operatives would jeopardize his political survival. 'Clearly, there is a great willingness to help Musharraf,' an American intelligence official told me. A C.I.A. analyst said that it was his understanding that the decision to permit the airlift was made by the White House and was indeed driven by a desire to protect the Pakistani leader. The airlift 'made sense at the time,' the C.I.A. analyst said. 'Many of the people they spirited away were the Taliban leadership'-who Pakistan hoped could play a role in a postwar Afghan government. According to this person, 'Musharraf wanted to have these people to put another card on the table' in future political negotiations. 'We were supposed to have access to them,' he said, but 'it didn't happen,' and the rescued Taliban remain unavailable to American intelligence.
According to a former high-level American defense official, the airlift was approved because of representations by the Pakistanis that "there were guys- intelligence agents and underground guys-who needed to get out." (ibid)
<snip>
US officials admitted, however, that "what was supposed to be a limited evacuation apparently slipped out of control, and, as an unintended consequence, an unknown number of Taliban and Al Qaeda fighters managed to join in the exodus." (quoted in Hersh op cit)
An Indian Press report confirms that those evacuated courtesy of Uncle Sam were not the moderate elements of the Taliban, but rather the "hard-core Taliban" and Al Qaeda fighters. (Times of India, 24 January 2002). http://globalresearch.ca/articles/CHO403D.html