He was an ally of the US during the Russian/Soviet occupation of Afghanistan.
Do your homework, because no he wasn't.
UBL was not in any working for or receiving direct support from the United States or the CIA.
The misconception that leads to this myth goes down to the use of the word Mujahadeen. During the Soviet-Afghan war two separate and unrelated entities used this term. On one hand you had the Afghan Mujahadeen force comprised of (you guessed it) ethnic Aghani's who would later become the Northern and Southern Alliances during the rule of the Taliban. On the other hand you had the Arab Mujahadeen which can pretty much be seen as the start of Al Queda. The Afghani's wanted NOTHING to do with the Arab forces, and would have wanted nothing to do with the American's and CIA but we were a means to an end. We provided monetary support and of course the Stingers which the Afghani's would have been stupid to refuse.
Now, you have to take into account there were two seperate programs providing support. One which provided material and money directly to the Afghani resistance fighters, the other which funneled that support through Pakistan. Pakistan only wanted to funnel the money to those fighters who they thought would give them the most influence in post-Soviet Afghanistan. This ended up being the Pashtu Tribes (who would later be known as the Southern Alliance) and the Arab Mujahadeen.
So yes, American money DID reach "Al Queda" and UBL, but none of it was direct and he was not on our payroll. In fact, UBL was hardly a known commodity until late in the war and the incident that brought him his fame is most likely nothing more than a fairy tale.
Read the books First In by Gary Berntsen and Jawbreaker by Gary Shroen. These were two of America's most knowledgeable experts on Pakistan and Afghanistan and they pretty much tell the above story.