The big attraction of course was oil, and Libya had a lot of it, almost 2% of the world reserves, and the West and China wanted to get their hands on it. The West was particularly concerned about the huge contracts that China had signed with him ( Saddam had also made the mistake of signing huge Contracts with China to the exclusion of the West, prior to its invasion by "oilman" Bush and others). The West especially Britain and Francwe had been locked out, together with the USA.and they were hurting economically and oil was the key.
Gadaffi was now the "poster boy" of the West (one of his sons would be invited by Hillary Clinton to the State Dept later) and Berlusconi was proud to call him a "friend". It was reported that the CIA also wanted to write his speech, in 2003, denouncing nuclear weapons, Gadaffi was also a crucial ally in the fight against al Qaeda and Islamist/Jihadist. He had been battling them, especially in Benghazi, from where many had gone to Iraq to fight the American invasion. Gadaffi had put many of them in prison( hundreds were freed after the rebels took Tripoli...what mischief will they cause? especially with so much weapons from shoulder- fired missiles to mustard and sarin gasses etc. available, now that Gadaffi does not control them).
The CIA and MI6 quickly formed a close relationship with Moussa Khoussa, the feared and hated head of Libyan External Security Org.( he fled to Britain in the early days of the rebellion...warned ahead of time by his buddies?). Torture is illegal in USA and Britain, so Libya became the "rendition"place of choice. At least 8 prisoners have been sent there by the CIA according to documents found in the ransacked offices of the External Security Org. There are more reveleations and embarassments to come. The co-operation was extensive and lasted until the Feb. uprisings, just before the NATO. bombings began. Abdel Hakim Bellaj, now military leader of the rebels has claimed that he was arrested and tortured by the CIA, in March 2004, when he was head of the Islamic Fighting Croup, whose objective was to overthrow Gadaffi
This marriage of convenience was very close while it lasted. Why the about face? Was it because there was new leadership in USA and Britain or was it because Gadaffi was getting too close to the Chinese,"b who have been using their $3 trillion in reserve to uy' Africa and its resources, very troubling indeed to the West, especially the former colonial masters, Britain and France who were therefore most eager to get rid of Gadaffi and brought a reluctant Obama aboard. Oil is the key as it was and still is in Iraq.
This is not over and it will not be over, even if Gadaffi is captured/ killed. There will be instability and hatred for years to come. The Middle-East and North Africa will be a hot bed for terrorist activities and the West will pay dearly for its double-dealings.