It's always a very difficult debate about whether or not a stable monster in power is better than the destabilization and power vacuums caused by removing him. This is a debate that rages on about most of the big names of people we really really really don't like. Look at the leader for any country in the world that the West doesn't like and the question is not "could we kill them", but "what would happen if we did".
Gaddafi had been on the international shit list for a very long time. He was a very bad person who did some very bad things. He was left alone because, as bad as he was, Libya was a stable country and a generally stabilizing force in an otherwise highly unstable region. A shattered Libya was always seen as being a worse thing than dealing with Gaddafi in power, even as much as we hated him.
The Arab Spring changed the equation though. Dictators were falling, unrest was happening. There was a VERY real possibility that Libya was going to shatter and descend into civil war no matter what anyone did. The reason to leave him alone was gone, but all the reasons we wanted him removed were all still very much there. And the best part is that it wasn't even our fault. He could be removed and we didn't have to be on the hook for killing him (generally considered to be a serious international faux pas, kinda like bombing hospitals or being photographed with a visible boner when meeting the wife of another leader), all we had to do was keep him from bombing his civilians to shit and let everything else play out. And when have we ever passed up a chance to get something we always wanted while looking good in the process?