This is carping, to complain that Obama intervened in the Libyan civil war. Gaddafi was responsible for a number of terrorist attacks on the U.S. When possible, the U.S. should settle such scores. Done.
But that's just the Machiavellian reason. There is a moral reason too. Gaddafi, at the point where we sent bombers in, was lining up his troops and artillery to lay waste to Benghazi. He had vowed a massacre. We stopped that. Obama was right to do it. We had the means at hand, we had good reason, and the costs were not going to be prohibitive. Not even really painful.
There are many things Obama has got wrong. But he got it right on the question of Libya and Gaddafi.