James Kirchick makes a useful argument:

The guiding principle of American foreign policy should be to support freedom overseas, when we can, where we can, and however we can. There are no firm rules by which this principle can be implemented. Libya, however, presented a rather obvious case: a murderous dictator who had the blood of many thousands of innocent people--including American citizens--on his hands, who had fomented instability in his region, and who had for many years been a leading sponsor of international terrorism, was suddenly confronted by a mass domestic insurgency. He reacted violently, in a way that rendered moot whatever economic benefit he was providing to the West. He all but announced his intention to commit genocide against his own people, stating that he would "cleanse Libya house by house," practically rendering international intervention a legal imperative due to the stipulations of the Convention on the Prevention and Punishment of the Crime of Genocide, to which the United States is a signatory. Furthermore, from a basic practical standpoint, and unlike in Yemen and Bahrain, Libya is located on the periphery of Europe, meaning that continued strife would have resulted in a mass refugee exodus onto the shores of NATO states.