Politics has many layers. And the layers seen by the general public are certainly the most shallow and misleading ones. In political decisions complex geopolitical, historical, strategic and other factors play part. In this regard, Gadaffi was a splinter in the toe of many western countries for decades in a row, but everyone was busy with other wars and conflicts to engage him. The recent civil unrests in Libya simply became this long-awaited justification factor and in a good time too (when everyone is free to engage), so they did.
Let's also not forget that Libya has oil, which is another strategic factor that plays a major role in the decision to engage it militarily. In reality, no one really cares about the actual deaths of people, their rights or suffering. It is all business and gain. This is what politics is, behind the public layers.