I've heard some religious scholars claim that thou shalt not kill is a mistranslation. The original text uses the ancient Hebrew word for murder. Thou shall not murder would be the accurate commandment if this is true. Killing in war or self-defense is not forbidden or apparently considered a sin by God. The taking of innocent life is the true sin in his eyes.
Thou shalt not kill kept a lot of good people from stomping the guts out of Evil for more than a millennium. Fake Religion was around long before Fake News.