As I said above, it's a matter of how the story developed over time. Without the ability to recall books off the shelves and retcon them, there's bound to be a disconnect if the author is telling a more adult story in the later books.
Nevertheless, they are all children's books, and although 'kill or be killed' is reality at its worst, it's still not something to teach children. JKR lists any number of spells that can cause as much, if not more, damage than a gun, but they are used almost exclusively by the bad guys, because JKR is teaching children that harming life is evil. It's not realistic, it's idealistic.
In terms of the good guys never killing anyone, I recall the A-team was similar. No matter how many guns or explosives they used, or how high a vehicle shot into the air with explosive force, the bad guys were always seen climbing unharmed out of the wreckage. It's what kid's books and TV shows do. If they didn't do that, they wouldn't get their G/U rating.
Nor is it limited to kids' stuff. There are hundreds of books and shows where the good guy utters something along the lines of "If I stoop to [defending myself realistically] I'm no better than [the bad guy]." Unrealistic twaddle like this is a staple of our entertainment. Why single out Rowling?
gladuisdei:
No one in desperation tries to knife headmaster snape, or pull a gun when the evil death eaters come to drag their wives away to be tortured to death?
Where exactly, in Britain, are you going to obtain a gun to pull?
Knives? A 'Sharp' spell on a wand could turn it into a knife, but as Truemane suggested, that would be so uncouth.
It would also be evil. Wars are hellish because in reality both sides commit atrocities in the desperate struggle for survival. If one side plays by rules of fair play and the other side doesn't, the evil side is going to win. Unless someone 'waves a magic wand over the situation'.
That's the whole point of the Potterverse - that by using good magic for good, you can overcome the evils of the world - both wizardly evils and muggle evils.
The moral of the story is that good magic and fair play wins the day. It's a fairy tale.