He probably thought that he was signing up with the United States since it was the U.S. who brought Al Qaeda into existence in the first place.

Allies can become enemies in a matter of few months. Until 1992, the Americans were supporting the Taliban / Al Qaeda, helping them with weapons, and even transporting foreign mercenaries from Saudi Arabia and Egypt to Afghanistan. Even in the late 90s, when Taliban was fighting against the Northern Alliance, the Americans were inclined to support the former, as the Northern Alliance was believed to be pro-Russian.
Exactly what the Taliban / Al Qaeda thought when the U.S. turned on them.