Question: Why did God command the genocide of the Canaanites?

In Deuteronomy 20:16–17, God commanded the Israelites, “In the cities of the nations the Lord your God is giving you as an inheritance, do not leave alive anything that breathes. Completely destroy them—the Hittites, Amorites, Canaanites, Perizzites, Hivites and Jebusites—as the Lord your God has commanded you.” A similar command is given concerning the Amalekites in 1 Samuel 15:2–3. Why would God have the Israelites exterminate entire groups of people, women and children included?Before we look at the reasons given in Scripture for the commands to exterminate certain groups of people, it’s important to realize that the Israelites were not given free rein to slaughter everyone they met. Consider the following:• The standard procedure for battling a city was to first extend terms of peace (Deuteronomy 20:10). If the terms were accepted, the people of that city lived and became subservient to Israel (verse 11). If the terms were rejected, the city was besieged and the men were killed, but the women and children were spared (verses 12–14). Attacking a city within Canaan called for different rules and represented an exception to this standard.• God did not sanction all of the wars recorded in the Old Testament. The battles that were part of the conquest of Canaan were intended for a particular time and limited to a particular people group. The conquest of Canaan had clear limits, geographically and historically.• The wars sanctioned by God beyond the time of Joshua were defensive in nature. A number of the battles that Israel fought on the way to and within Canaan were also defensive in nature (Exodus 17:8; Numbers 21:21 –32; Deuteronomy 2:26 –37; Joshua 10:4).Here are the reasons Scripture gives for commanding ancient Israel to annihilate certain people groups:1. To judge the Canaanites for their abominations. The Canaanites were a brutal and wicked culture that frequently engaged in incredibly decadent behavior. Leviticus 18 provides a list of sins that Israel was to avoid at all costs: incest, child sacrifice, homosexuality, and bestiality. All these sins were practiced by the people of Canaan: “This is how the nations that I am going to drive out before you became defiled. Even the land was defiled; so I punished it for its sin, and the land vomited out its inhabitants. . . . All these things were done by the people who lived in the land before you, and the land became defiled” (Leviticus 18:24–27).In ordering the destruction of the Canaanites, God enacted a form of corporate capital punishment on a people that had been deserving of God’s judgment for some time. God had given the Canaanite people over 400 years to repent (Genesis 15:13–16). Then came judgment day. God could have used any means to destroy the Canaanites, but He chose to use the Israelites as the instrument of judgment. This method not only rid the world of an evil and deeply depraved society, but it also provided a ready-made home for God’s chosen people, the Hebrews.The Canaanites knew what was coming and had heard of God’s awesome power (Joshua 2:10–11; 9:9). Such awareness should have prompted their repentance, but they remained resistant to God. The Canaanite Rahab was saved, and so was her family, and they are proof that the Canaanites could have avoided destruction if they had repented (Joshua 2). No person had to die. God’s desire is that the wicked turn from their sin rather than perish (Ezekiel 18:31–32; 33:11).2. To stave off idolatry and compromise. In Deuteronomy 20, immediately after God commanded that the Canaanites be completely wiped out, God gave the reason: “Otherwise, they will teach you to follow all the detestable things they do in worshiping their gods, and you will sin against the Lord your God” (Deuteronomy 20:18). The reason for the extermination was to prevent religious compromise and spiritual adultery: if the Israelites left survivors, the sin of idolatry would follow.The Israelites failed in their mission and left many Canaanites alive (Joshua 16:10; 17:12–13; Judges 1:29). Exactly what God said would happen occurred. Israel compromised with Canaanite culture and fell into idolatry time and again (Judges 2:1–3; 1 Kings 11:5; 14:24; 2 Kings 16:3–4). God’s order to exterminate the Canaanites was meant to guard His relationship with His people.3. To prevent future problems. God knows the future. God knew what the results would be if Israel did not completely eradicate their enemies. The Amalekites were not Canaanites, but they attacked Israel several times and forged alliances with the Canaanites (Exodus 17:8–13; Numbers 14:45; Judges 3:13; 6:3), so they also fell under God’s judgment.  King Saul was given the responsibility to exterminate the Amalekites (1 Samuel 15:2–3). Saul shirked his duty and lied about it (1 Samuel 15:20). The results were dire—just a couple of decades later, there were enough Amalekites to take David and his men’s families captive (1 Samuel 30:1–2). Several hundred years after that, a descendant of the Amalekites, Haman, tried to have the entire Jewish people exterminated (see the book of Esther). So, Saul’s incomplete obedience almost resulted in Israel’s destruction. If Saul had obeyed the voice of the Lord, it would have saved David’s men and the Jews of Esther’s day a lot of trouble.4. To fulfil the curse on Canaan. Centuries before Moses’ command to eradicate the Canaanites, Noah had cursed one of Ham’s sons: “Cursed be Canaan! The lowest of slaves will he be to his brothers” (Genesis 9:25). Canaan was the ancestor of the Canaanites, as Genesis 10 makes clear. The descendants of Canaan include the Sidonians, the Hittites, the Jebusites, the Amorites, and the inhabitants of Sodom and Gomorrah (Genesis 10:15–19). Noah’s curse/prophecy came true during the time of Joshua. The Canaanites were conquered by the Israelites, who were descendants of one of Ham’s brothers, Shem. Not all of the Canaanites were exterminated; true to God’s Word, some of the Canaanites became slaves (Joshua 9:27; 17:12–13).The most difficult part of the command of Deuteronomy 20:16–17 is that, when the Canaanites were exterminated, women and children were not spared. Why would God order the death of noncombatants and innocent children? Here are some things to remember:⁍ No one is “innocent” in the sense of being sinless (Psalm 51:5; 58:3).⁍ These women were participants in the degrading sins of Canaan, and the children would have grown up sympathetic to the evil religions and practices of their parents.⁍ These women and, eventually, the children would naturally have been resentful of the Israelites and later sought to avenge the “unjust” treatment the Canaanite men had received.In the end, God is sovereign over all of life, and He can take it whenever and however He sees fit. God alone can give life, and God alone has the right to take it. God is under no obligation to extend anyone’s life for even another day. How and when we die is completely up to Him. In the case of the Canaanites, their end came after a time of tolerance and patient grace. But Judgment Day finally comes to all, and it came to the Canaanites via the Hebrew people.