All to the sword?

DT 2:34 "At that time we took all his towns and completely destroyed them—men, women and children. We left no survivors."
 
These are some of the most difficult verses in the Bible, why would God command this?  Here are some thoughts in reply:
 
If we take God to task for these deaths, we should take God to task for all deaths, does he have this prerogative to make this decision in any case?
 
And can even the youngest children be completely wicked?  We speak of infancy as a time of innocence, and certainly children are not conscious of evil like adults are.  But we read that children can be filled with the Holy Spirit even from birth, and children can also be indwelt by evil spirits from an early age:
 
Luke 1:15 ... he will be filled with the Holy Spirit even from birth.
Mark 9:21  Jesus asked the boy's father, "How long has he been like this?" "From childhood," he answered.
 
Similarly, even the youngest can turn to God or turn away from God:
 
PS 22:10 "From birth I was cast upon you; from my mother's womb you have been my God."
Psalm 58:3 The wicked are estranged from the womb; These who speak lies go astray from birth.
(See also Ps. 51:5 and Isa. 48:8)
 
Thus apparently both righteousness and wickedness can start at an early age, even within the womb, and when the sin of the Amorites reached its full measure (Dt. 15:16), apparently all the people, men, women and children were completely wicked.
Now even righteous people do not deserve life, life is always a gift, not a due payment that we deserve:
 
PS 9:13 "Have mercy and lift me up from the gates of death."
PS 102:24 So I said: "Do not take me away, O my God, in the midst of my days!"
RO 5:12 "Therefore, just as sin entered the world through one man, and death through sin, and in this way death came to all men, because all sinned."
 
So God is not unjust to require the death of anyone. But we may be thankful that God loves us, and that his heart is to give mercy and grace, and life.

We should consider as well that God bears suffering, as in the cross:
 
Isaiah 53:4,12  Surely he took up our infirmities and carried our sorrows ... For he bore the sin of many...
 
This is also illustrated by those who serve God and have his motives, bearing suffering when they inflict judgment, too:
 
Jeremiah 8:21 Since my people are crushed, I am crushed; I mourn, and horror grips me.
 
The question being raised here actually comes up in regard to the death of any infant, people blame or question God when an infant dies of illness, yet God bears suffering:
 
Matthew 10:29 Are not two sparrows sold for a penny? Yet not one of them will fall to the ground apart from your Father.
 
If this is true of sparrows, how much more of children? If God is not apart from animal suffering, how much more of human suffering?
 
But could it be that God regrets bringing about the death of any person? If God sees a good purpose, even in this, I think he may be said to not have regrets, or be guilty of sinning. We can see an example of a reason, when God's command of judgment was not carried out completely (Num. 25:17-18; Josh. 13:21; Judges 6:1), and this resulted in oppression later on:
 
Judges 6:2 Because the power of Midian was so oppressive, the Israelites prepared shelters for themselves...
 
Moses also gives a reason for a commanded judgment, and that is the sin the non-virgin girls would bring:
 
Numbers 31:16  [The women] were the ones who followed Balaam's advice and were the means of turning the Israelites away from the Lord in what happened at Peor, so that a plague struck the Lord's people.
 
So God sees the end from the beginning, and the result of any action he takes or commands. God waited until the wickedness of the Amorites was full, and then judgment was commanded, which implies indeed complete wickedness, of men, women, and even children.
 
I don't want to contemplate carrying out a command like this. Nor do I want to contemplate cutting off my hand or my foot, in order to give up sin (Mt. 5:29-30). But if there is a cause of sin, it must be addressed by obeying the Lord, and the result will yet be for good.
Death is not ultimate evil, if there is life beyond the grave, and we cannot see that far, to know all outcomes of all events.

In addition, we may note that the Amorites were reported to be extraordinarily tall, and although a height greater than 9 feet is typically accompanied by unusual health difficulties, the Amorites were renowned for their tall warriors, indicating that these warriors had no such debilitating problems, Goliath was well over 9 feet tall and carried 125 pounds of armor, his javelin was said to be like a weaver's beam (1 Sam. 17:4-7).
 
So if the Biblical account is accurate (which is why there are criticisms of these judgments in the first place), then this may have an implication of supernatural abilities here. We may then also note the passage about "The sons of God taking wives from the daughters of men" in Genesis 6, when the Nephilim were on the earth, where one interpretation has been that these were the offspring of women and fallen angels.
 
This may then explain the judgment of the Nephilim, all of them, men, women and children, in the flood in Gen. 6-8, and the judgment of the Caananites, if they had become like these Nephilim.

Many aspects here were supernatural, the record shows the walls of Jericho fell down, in another instance, there were hailstones as well as swords (Josh. 10:11), and the sun stopping, and other supernatural judgments:
 
Joshua 24:12  I sent the hornet ahead of you, which drove them out before you-- also the two Amorite kings. You did not do it with your own sword and bow.
 
Deuteronomy 7:19  You saw with your own eyes the great trials, the miraculous signs and wonders, the mighty hand and outstretched arm, with which the Lord your God brought you out. The Lord your God will do the same to all the peoples you now fear.
So when people compare these events to ordinary human battles, the comparison would only be accurate if there were also similar supernatural judgments, especially since the criticisms of these accounts is a criticism of the account within the Biblical framework, the objection is that these deeds were wrong on their own terms, within the Biblical context.
 
Joshua 11:20  For it was the Lord himself who hardened their hearts to wage war against Israel, so that he might destroy them totally, exterminating them without mercy, as the Lord had commanded Moses.
 
So all these events were inherently supernatural, not simply natural actions done by the strength of Joshua and the Israelites, who were actually quite outnumbered. So primarily God did this, and then we need to ask again if God has this prerogative, does God have the prerogative to determine the time and manner of a person's death? The question raised by these judgments seems to essentially involve the question of whether God has a right to decree this. Now Scripture is clear that God has this prerogative, for he knows enough to make this decision, and we do not know enough.
 
Daniel 5:23 But the God in whose hand are your life-breath and your ways, you have not glorified.
2 Kings 5:7  As soon as the king of Israel read the letter, he tore his robes and said, "Am I God? Can I kill and bring back to life?"
 
Then a second question can be asked, "Does God involve people in carrying out his decisions?" We do see this in the Bible, with Abraham (Gen. 22), and with the Israelites. Now people might object that simply carrying out orders does not exonerate a person, the question then becomes, as above, is the one who is making the command someone whose right it is to do this, and is there also a way even a judgment of death, for a given person, could result in good, even for them?

Further references:
Christian Think-Tank discusses the account of Midian in Numbers 31.
They also have a discussion on the Amalekites, and the Canaanites.