I don't think God condones war or makes excuses for it, but in his wisdom he can use circumstances which he does not approve of to do good works. This is why he often ordered the Israelites to ritually purify themselves before and after battle, and to have compassion on their defeated enemies and go back to take care of the wounded and fallen. Through these dark circumstances, God seems to be saying "If you're going to do this thing, you're going to do it MY way."
Yes, God commanded the ancient Hebrews to engage in battle, but I do not think this is because God considers war to be good, appropriate, or even justifiable. I think it was because God was present and active in human history, and in order to make sure that his people did not spiral out of control on a warpath (as they had a habit of doing), he took charge of the movement.
Furthermore, the nature of the Kingdom changed after the Incarnation of Jesus. While Israel was a state (that is, country), it had the necessity of protecting its borders from those who would oppose it--that is the natural order of established nations, because all nations, including Israel, have the desire to expand their territory and increase their influence. However, the Kingdom of God transitioned from physical to spiritual with the coming of Jesus. It is true that he said "Do not suppose that I have come to bring peace to the earth. I did not come to bring peace, but a sword. (Matt. 10:34)", the sword he was talking about was the Sword of the Spirit (Eph. 6:17) that HEALS even as it strikes. No physical weapons do this.
No doubt you are wondering about what we would consider atrocities of war, such as the extermination of entire populations of people. To this I say: God judges the soul, not humans. To the Hebrews, killing a man was merely sending him to meet his maker so that he could be judged, because that office is reserved for God alone. They took the phrase "Who are we to judge?" very seriously in these matters.
Furthermore, hell did not exist as such in these days, or at least people were not sent there to dwell with the Enemy as they are in these days, now that we are held to a higher standard because we have the complete revelation of God that was made clear in Jesus Christ. The only mention of such a place is what they called "Sheol", the land of the dead, and it was similar to the Greek "Hades" (in fact some of the disciples used this word as a transliteration) in that everyone went there; Jesus said "No one has ever gone into heaven except the one who came from heaven--the Son of Man. (John 3:13)"
So as you can see, putting a man to death was not as great a grievance as it is in this day, because death was seen as the way to send a person's soul to judgment. (It also stands to reason that the children of the enemies of God would be better off in heaven than grow up to be enemies of God like their parents, and then bring God's wrath down upon themselves.)
In these days we are charged with spreading the revelation of Jesus Christ to all people, and every death means that one more person died unfulfilled and incomplete, unable to live up to the purpose God intended for their lives. We are not set up as the bringers of death and judgment, but the messengers of life and restoration of the spirit. And we wield the sword that heals even as it strikes--and that sword only.