The death penalty is a punishment in response to ordinary criminal acts. Even countries that have abolished the death penalty reserve the right to kill people in war.
There is a fundamental difference between policing and military action. Applying civilian legal standards to military situations is a bad idea because it inevitably results in watering down ordinary criminal protections to accommodate the needs of military situations.