How can a loving God order people killed?

In the Old Testament, God commanded the Israelites coming out of Egypt to take over the land of Canaan and kill all of the inhabitants. This is shocking to us. Skeptics point to this and say that there must be something foul about the Christian God. Yet, the Bible makes it clear that God is not arbitrary; the Canaanite society deserved its fate as it was thoroughly polluted by its wretchedly evil practices, including the horror of child sacrifice (Deuteronomy 9:1-6, 12:29-31, 18:9-14,  1 Kings 14:24,  2 Chronicles 33:1-9, Ezra 9:11).

Thus God used the Israelites to administer specific justice, just as He later used other societies to administer justice against the Israelites (book of Jeremiah). Instances such as this in the Bible are each a particular limited circumstance in time, for a particular purpose established by God.

But the skeptic presses the point by asking, "But weren't some of those people innocent?" To the extent that there are ever innocent people whose lives are cut short, only Christianity brings hope for those in heaven. However, there is a further context to such violence. As mentioned in the previous section about the question of people who may never have heard about Jesus, there are no innocent people. We are all sinful by nature and deserving of God's wrath (see Christian Cram Course).

We are not just sinful at the margins. As seen by an infinite and holy God, our proclivities are "deceitful above all things" (Jeremiah 17:9). At times, mankind's wickedness and violence against each other are so outrageous that God has has cried out that "every intention of the thoughts of their heart is evil continually" (Genesis 6:5).  History attests to this. It has been suggested that one-third of all the people who ever died on earth has been at the hands of other humans.

Philosophically speaking, if you do not believe in divine judgment, you have no answer to human violence. If you are outraged at human violence, especially if you have ever experienced it against YOURSELF, you have to believe in a judge greater than yourself because you don't have the authority or ability to judge rightly. Otherwise, as so many of our fellow humans have done, you will take up the sword yourself and continue the cycle of violence.

Christians believe in a just God, and one that grieves at our sins. In Genesis 6:6, the text says three times that God was "sorry" for having to extract justice on a wicked people. This gives insight into the nature of God.

At the same time, we are confident that God's plans are greater than our limited understanding. Since the God of the Bible is merciful as well as just, we are confident that if there were truly innocent people who were killed under God's command that He would provide mercy and rest for them in heaven.

Our span of life on earth is a mere drop in the bucket compared to the infinite time in the life to come. Recognizing this, it becomes easier to grasp that there is a much bigger context than our troubles and complaints here on earth.

Perhaps a modern comparison is worthwhile. Were the United States and Britain wrong to bomb German and Japanese cities during World War II, killing innocent citizens? If this action seems potentially justified, perhaps we shouldn't be too quick to judge God in this Old Testament situation.

Moreover, God uses history to play out the human condition to show the need for a savior. It is history that demonstrates the incredible mercy God has shown by sending his son to absorb the penalty for man's sins.

Can a God of love also be a God of wrath? Of course. All loving persons are sometimes filled with wrath precisely because of their love. What kind of a God would not be angry at injustice and evil? 

We must remember that God is God! He controls all of life and death, even our own. Add to that the sinful nature of us all, God owes us NOTHING! It is a miracle that God spares any of us. And just because we finite people cannot understand or think of a good reason why God does something, does not mean that there is not a good reason.

The God who created life has the right to take it as well. Perhaps only through the violence of the Old Testament can we appreciate the new order found in Jesus and the New Testament. The battles we face are no longer physical but spiritual (Ephesians 6:10). Contrary to the short-sighted skeptic who claims that the Christian God displays an inferior morality, the Creator God of the universe sent his only son to demonstrate the perfect morality. The teachings and life of Jesus are universally acknowledged even by skeptics to be sublime (for example, read Jesus' Sermon on the Mount. And in a gesture of ultimate morality, God gave his only son to pay the ransom for the sins of the world. As Jesus said :

Greater love has no one than this, that he lay down his life for his friends (John 15:13).

Here's an inciteful article by a former Muslim comparing Old Testament violence with the Quran: Nabeel Qureshi.

Here's a helpful article that puts all of this in context: Genocide

Here's a nine minute video on this: Craig on Genocide

And here is a list of reason why: Seven Reasons