The gemara in Yoma (22b) tells us that when Shaul received the command to wage war and destroy Amalek, he made a kal v'chomer: if the Torah takes the death of one innocent person so seriously that it demands that the closest city bring an eglah arufah, kal v'homer how horrible killing thousands is. And even if the adults of Amalek are sinners, what of the children? What of the animals of Amelek? A bas kol echoed down and warned Shaul, "Al te'hi tzadik harbei," don't be so frum. The mitzvah is to destroy Amalek, period.
Was Shaul haMelech, who Chazal describe as perfectly righteous, questioning the mitzvah of waging war against Amalek!? Did he have in mind from the get-go that he was not going to fulfill the dvar Hashem?
Rav Shach quoted an amazing hesber from R' Issar Zalman Meltzer (see this post from a few years ago as well): Shaul haMelech certainly was planning on fulfilling the dvar Hashem. However, to go slaughter thousands and not become a barbarian oneself is not so easy. How does one go out and kill men, women, and children and not lose something of one's humanity?
Shaul had a solution. Before the war he gave a tremendous mussar shmooz reminding everyone just how repugnant what they were about to do is. No one should go into battle thinking this was something done easily, something that should be relished or enjoyed. Our attitude has to be that what is being done is morally detestable! Nonetheless, we will do it anyway.
The bas kol answered Shaul that he was gravely mistaken. Yes, murder is detestable, war and barbarism run contrary to our ethic. But when Hashem says to kill Amalek, it means that doing do is not murder, is not barbarism, and is not morally detestable -- to the contrary, to not eradicate Amalek is to turn a blind eye to evil and enable it. War in this case is an act of chessed -- for the Jewish people and for the world. And doing G-d's chessed, even by fighting a war, in no way can corrupt a person.
We see from the Purim story just how wrong Shaul's calculation was. What was the result of fighting Haman, of fighting Amalek? "Kiymu v'kiblu" -- a renewed kabbalas haTorah, a rededication to all that is moral and good. Fighting evil does not weaken one's morality -- it strengthens it.
As I write this the news reports are coming in that the IAF is striking back at Hamas for the rockets launched at Tel Aviv earlier. This is milchemes Amalek.
Of course we should not take life indiscriminately. However, why is it that before we strike back at our enemies we seem to have a need to klap 10 Al cheit's in advance, to give them a week's warning to get out of the way, we need at least a minyan of Senators or Congressman to reiterate that we have a right to defend ourselves, etc? Al te'hi tzadik harbei! The defense of our homeland and our people is a mitzvah and is the greatest chessed, not only for us, but for all peace and freedom loving people. Doing so is an act of moral courage.