Let's go ahead and dig on in. We start with that first question what reason could God have for commanding war? We can give several answers to this question; the first being the nation of Israel itself you see in the Old Testament to accomplish his plan of redemptive history. God chooses the nation of Israel by making that choice though he's now committed himself to operate within a specific framework that is the framework of a nation and here we encounter war.
War is necessary for any nation to survive. Any nation that is unable or unwilling to defend itself ultimately will be captured or destroyed, and especially a nation in a very sought-after region of the fertile crescent like the land of Canaan where Israel goes. By God choosing Israel as his kingdom of priests and the holy nation he has to allow them the capacity for war to defend themselves and exist in that region. So that's one reason why God could command war.
The second reason God commands war is to reveal his character and nature on a national and international stage. Now that sounds odd but let's explain a little bit. We're dealing with the context of the ancient near east, the context of ancient Israel seen in modern terms.
When we look at war, we think of the soldiers, the commanders, the nations that might be embroiled in this conflict. The ancient world certainly looked and saw those things, but they also looked up and had a cosmic view of war. See when you as a nation went to war it was not just your people, your armies and your commanders, it was your gods who joined you on the battlefield. Victory was not just the successful conquest of arms of one group over another, it was the proof that your gods were actually supreme, that your gods came and defeated the gods of your opponents.
How does this fit into our conversation? Well God is clear through his revelation that he is the supreme God. There is none like him, there is none beside him; that's the first commandment of the ten commandments. So, when Israel goes and fights what is that revealing not just to Israel but to the nations around them? Well, if they can go and fight and overcome, they are proving to themselves and their neighbors that their God is real, that their God is true, and their God is powerful. So, we see God has good theological reasons and context to allow Israel to go to war.
Third and finally we can also point out that war is a tool of judgment against sin. We see this perhaps best in the conquest of Canaan. God is quite clear that the Canaanites, as they are being driven out by the people of Israel, are being driven out because of their sin. We can look at numerous passages, for example, Genesis 15, Deuteronomy chapter 9 and Joshua chapters 9-11, all these point out that God has given the people of Canaan numerous times, in fact hundreds of years, in order to repent and change from their sins.
God is a patient God, but he is ultimately just and so in this context, war is used to punish sin in a somewhat dramatic turn of historical irony. War is actually going to be the tool of punishment that God uses against Israel when he brings up the Assyrian and Babylonian people. Let's put these three ideas together why might God command war in the Old Testament. Well, we've now seen three reasons. First, because it's a tool of the state necessary for survival. Two, because it is a theological means to communicate God's supremacy and power in the ancient near east and third, because it is a tool of judgment against sin with that kind of covered.