The objective of war is to compell your adversary to do your will.
Within the above, even that tactics of Ghenghis Khan are fully legit.... (if we followed such tactics, there would be no life in Bhagdad....)
WESTERN militaries (and some non-western militaries that have adopted the code), over the last several centuries, by deliberate choice, added a LARGE does of ethics into warfighting, in the form of christain influenced chivalry (I'm not a christain).
The SUCCESSFUL addition of ethics into western militaries reached its high point in the 18th and 19th centuries, especially when both sides in a conflict largely abided by similar values (when they did not, it quickly degenerated).
The 20th century saw more aggressive 'strategic war', but even there, an airman in B-17 always believed ('almost' always correctly), that some sort of military target was on the recieving end of his bombs. As before, when both sides abided by modern chivalry, it worked. When fake surrenders were used to make ambushes, it degenerated fast (for example, early in the fighting at Guadalcanal, real effort was made to humanely collect what "seemed" to be surrendering Japanese. Repeated fake surrender and ambush made it a much harsher campaign in the Pacific....).
Ideally, in the modern military mind, a fight would be between military forces, with no non-combatants anywhere around. This NEVER happens these days, even if BOTH sides want it to.
Furthermore, dual use targets complicate things. Taking out the power grid has a number of military purposes, but also affects non-combatants.
But even if bombing a production plant, there is still that underlying military purpose that is the target.
Terrorists don't work that way. AND THAT IS WHY THEY ARE SUB-HUMAN FILTH. (IMPORTANT NOTE: Not all militants are terrorists, but many are, to one degree or another.)
Terrorists strap bombs to the chests of the mentally disabled, and send them to blow up markets.
Terrorists go for mass body count of ANYONE to terrorize their enemy. They expand their target list to pretty much everything, but seem to delight in whatever is CROWDED with civilans.
but WORST of all, terrorists DELIBERATELY use the cover of non-combatants and non-combatant disguises to MAKE ATTACKS (hiding among non-combatants WHEN NOT ATTACKING is expected. LAUNCHING ATTACKS as while trying to appear as a non-combatant FORCES soldiers to treat non-combatants as posible MILITARY targets, thus radically increasing risk to innocents).
War is Ugly
But if you DEMAND that soldiers either be put in prison, or be suicidal, WHILE AT THE SAME TIME make excuses for terrorist, it Will get uglier that you can possibly imagin.