The means justify the ends

Reread that, you likely read the opposite at first. Our western societies are more and more going the opposite direction. Infringing on rights to safe lives.

I say, NO. The ends do not justify the means. Instead, the means justify the ends.

If you stood atop the world trade center on 9/11 with an anti-aircraft gun, knew what the plane is going to do if you do not take action but also know that there are a bunch of innocent civilians on board then you can either:
Jump of the building and flap with your arms hoping that does anything to slow your fall
or
Shoot down the plane.

The latter option would be murder.

If you arrive at a bad outcome but did so by just means then the outcome is equally just.
Whereas if you arrive at a "good" outcome but arrived there by criminal means then the outcome is equally criminal.