This is something you see in both City of Heroes and Champions Online: The mission where you must go and gather evidence for the police. The evidence is always at the back of the villain hideout, and you’ll need to defeat every single villain in the place in order to obtain it. So, you break in and trespass on the base, which is full of heavily armed men who try to kill you on sight. Their weapons, attempted murder, and secret base are somehow not illegal enough to count as evidence, so you must kill them all in order to steal their property and give it to the police, who then have enough proof to issue arrest warrants on the dudes you just sent to the morgue.
In the real world, justice is blind. In the superhero world, justice wears a bike helmet and drools on itself.