We didn't seek to conquer it, occupy it, or annex it. We did seek to support a popular uprising against a vicious dictator [edit: Something that we've unfortunately over-promised and failed to deliver on too many times, e.g. Hungary, Czechoslovakia, Kurdistan, Hmong people, any war where the Pentagon seizes on a "third way"], but we did that based on a doctrine that security for ourselves needed democracy abroad, especially in the Middle East and North Africa. Let me make the alternative case for a second: Helping democratic movements in the ME/NA was a misguided proposition, as obviously the region has zero history of popular governance and the only actual alternative to authoritarian rule there on the ground is, and has always been, hardcore 7th century Islamism which is among other uglinesses and human rights abuses, deeply unfriendly to us. And therefore it was a fool's errand to overthrow any dictator in the ME, because they were the ones keeping the street quiet.
Okay, now that I've made that case, here's the case for helping overturn Qaddafi and try for Libyan democracy: He was murdering his own people. He had done, and he would do it again. And given the climate, his state would become again a breeding ground for terrorism as it had been in the 70s and 80s.
Personally, I think it was stupid, but I don't think it was wrong in the sense that Russia invading Ukraine was wrong - precisely because I don't think propping up a dictatorship is morally valid, the way Russia was propping up Ukraine before 2014 and the way it still does in Belarus and all the former Soviet states.
What I'm saying is that the moral decisions are frequently poor strategic decisions, and they rarely work in concert, but the failure of one doesn't nullify the other; nor do our strategic failures provide justification for the moral failures of others. If something is wrong then replicating it would also be wrong, no?