You forget one minor thing. Innocent people are killed in wars all the time - even the good guys kill innocent people.
The killing of those innocent people are justified because of the greater good.
No, that's not right. Innocent people are not to be targeted and directly and intentionally killed at any time, not even in wartime. That is the definition of murder. It is prohibited by the Rules of Engagement of the U.S. Military, and the UCMJ defines it as a war crime.
Innocent people are, sadly, killed as part of the inevitable collateral damage of war: that is, if they are not directly targeted, nor are their deaths deliherate and premeditated.
This is analogous, not to abortion, but to a legitimate healing procedure on a pregnant woman which indirectly results in the baby's death: for instance, hysterectomy of a cancerous uterus when the woman was pregnant.
And in either case, a serious effort must be made to minimize the collateral damage. In the case of the pregnancy, sometimes the baby can be delivered prematurely and live. In the case of war, sometimes the civilians can be warned to evacuate before the place gets blown up.
The directly intended killing of an unborn baby or an innocent civilian = murder. The adjectives are important.