As they repeatedly say, especially Graff, they are doing what they have to do, and although there may have been other tactics that would have worked, there was no way of knowing whether or not the human race could be saved without violent action against the buggers. The buggers themselves, though they do not really appear as character until the very end of the novel, in the dream they send to Ender on the new world, are actually stuck in the same bind as the humans. What the human experienced as violence in the First and Second invasions was not actually violence to the buggers -- they had no idea that they were killing sentient beings. They had tried to communicate with the humans, but because the two species communicate so differently, this was impossible. Violence became necessary for them to ensure their own survival, and although eventually they succeed in prolonging their species' viability by finding a way to communicate, this option is not available for most of the novel.
Other characters commit violence not because it is strictly necessary, but because of human psychology. Stilson is one of these characters; he uses violence as a way of taking and keeping power in the form of his group's admiration and obedience. Another character who is very similar to this -- and whose character arc is also very similar -- is Bonzo Madrid. Bonzo is violent because of his Spanish pride and really because of is insecurities. He is not a very good commander, and he knows it but he cannot admit. When Ender shows how much better and smarter he is than Bonzo, Bonzo can't handle it. It starts when Ender is put in his army and Bonzo loses a good soldier in the deal. Bonzo uses the incident to belittle Ender and makes his army stronger. This shows the group-strengthening dynamic that focused violence can have -- something it is also necessary to use in real warfare, outside the battleroom and even outside the ages of this novel. Ender is forced to be violent towards Bonzo because of Bonzo's violence towards him, but Bonzo's motives are simply jealousy and pride. This is typical of male violence; it usually does not come purely from anger, but from a need to prove oneself better than another. In the scene between Ender and Bonzo where the two fight in the showers, Dink Meeker shows up and tells Bonzo not to do it because Ender is the best chance they have against the buggers. Ender, who understands the way Bonzo feels, thinks, "You've killed me with those words, Dink" (Card, 210). He knows that Bonzo's violence will only be stronger the more Ender appears better than him. In the fight, Ender ends up killing Bonzo -- though again he doesn't know it right away -- and again, he cries immediately afterwards. Ender is not the type of character who enjoys violence, but only uses it to protect himself.
What constitutes protection, though, is not always clear, and the symbolism in the novel helps explain when and why violence is necessary. When Valentine and Ender are on the raft he built on Earth, Ender kills a wasp, saying "I've been learning about preemptive strategies" (Card, 235). This symbolizes and foreshadows the major violence of the novel; that of the Fleet against the buggers. The wasp had not tried to sting Ender, but because he knew it could at any moment, he killed it. This is the same decision made by the commanders of the fleet; they are the Third invasion. Rather than waiting to see if the buggers are going to come back and finish off the entire human race, the humans decide on a preemptive strike, using necessary violence to prevent their own demise.
It is not a happy feeling, to know that violence is sometimes necessary. But what Ender tells himself after fighting Bonzo is largely true: "the power to cause pain is the only power that matters, the power to kill and destroy, because if you can't kill then you are always subject to those who can" (Card, 212). This is really only a half-truth, but when faced with violence and possible destruction, it is the only half that matters.