In 1 Samuel 15:2-3, God commanded Saul and the Israelites, “This is what the LORD Almighty says: ‘I will punish the Amalekites for what they did to Israel when they waylaid them as they came up from Egypt. Now go, attack the Amalekites and totally destroy everything that belongs to them. Do not spare them; put to death men and women, children and infants, cattle and sheep, camels and donkeys.'” God ordered similar things when the Israelites were invading the promised land (Deuteronomy 2:34; 3:6; 20:16-18). Why would God have the Israelites exterminate an entire group of people, women and children included?
This is honestly a very difficult issue. We do not fully understand why God would command such a thing, but at the same time we trust God that He is just – and recognize that we are incapable of fully understanding a sovereign, infinite, and eternal God. As we look at difficult issues such as this one, we have to remember that God’s ways are higher than our ways and His thoughts are higher than our thoughts (Isaiah 55:9; Romans 11:33-36). We have to be willing to trust God and have faith in Him even when we do not understand His ways.
Unlike us, God knows the future. God knew what the results would be if Israel did not completely eradicate the Amalekites. If Israel did not carry out God’s orders, the Amalekites would come back to “haunt” the Israelites again and again. Saul claimed to have killed everyone but the Amalekite king Agag (1 Samuel 15:20). Obviously Saul was lying…just a couple of decades later there were enough Amalekites to take David and his men’s families captive (1 Samuel 30:1-2). After David and his men attacked the Amalekites and rescued their families, 400 Amalekites escaped. If Saul had fulfilled what God had commanded him, this never would have occurred. Several hundred years later, a descendant of Agag, 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. God knew this would occur, so He ordered the extermination of the Amalekites ahead of time.
In regard to the Canaanites, God commanded, “However, 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. 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:16-18). The Israelites failed in this mission as well, and exactly what God said would happen occurred (Judges 2:1-3; 1 Kings 11:5; 14:24; 2 Kings 16:3-4). God did not order the extermination of these people to be cruel, but rather to prevent even greater evil from occurring in the future.
Probably the most difficult part of these commands from God is that God ordered the death of children and infants as well. Why would God order the death of innocent children? (1) Children are not innocent (Psalm 51:5; 58:3). (2) These children would have likely grown up as adherents to the evil religions and practices of their parents. (3) By ending their lives as children, God enabled them to have entrance into Heaven. We strongly believe that all children who die are accepted into Heaven by the grace and mercy of God (2 Samuel 12:22-23; Mark 10:14-15; Matthew 18:2-4).
Again, this answer does not completely deal with all the issues. Our focus should be on trusting God even when we do not understand His ways. We also have to remember that God looks at things from an eternal perspective, and that His ways are higher than our ways. God is just, righteous, holy, loving, merciful, and gracious. How His attributes work together can be a mystery to us – but that does not mean that He is not who the Bible proclaims Him to be.