There are certain people for which the prohibition falls aside. (I’m not even referring to capital punishment here, or extralegal punishment performed by Beis Din.)
One is obligated to kill in self-defense (Sanhedrin 72a) and if one is chasing after someone else to kill, rape, or some other of a specific list of sins (Sanhedrin 73a).
With that category alone, I might argue that the positive commandment to kill them overrules the negative one not to kill (אתי עשה ודחי לא תעשה, ex. Yevamos 84a), as both are phrased in the positive (and the negative, but the point is that there’s a positive here as well). Further, in the case of self-defense, the perpetrator is considered to already be dead (Shemos 22:1 as expounded by Sanhedrin 72a-b), and as such, לא תרצח couldn’t apply anyway.
In other words: the prohibition really is “thou shalt not kill,” but because a positive commandment overrules a negative one, these cases are exceptions.
However, we find cases in which it is permissible, but not obligatory, to kill:
- If someone steals from the Beis HaMikdash, curses with a sorcerer, or is intimate with a non-Jewess, while one is advised against killing them, one would be allowed to do so (Sanhedrin 81b-82a, with further exposition on Pinchas through 82b)
- If a Kohen serves in the Beis HaMikdash while Tamei, the young Kohanim take him outside and pierce his brain with wooden planks (Sanhedrin 81b)
- A Goel HaDam is allowed to kill his close relative’s accidental murderer (Makkos 11a cites a dispute in this regard, but the Halacha follows R’ Akiva that it’s merely permissible; see further here)
Given that there are so many cases where it’s permissible to kill, not just obligatory, we can no longer apply אתי עשה ודחי לא תעשה. It must be that לא תרצח means “thou shalt not murder,” rather than “thou shalt not kill.”