If you want to have a better understanding, Norman L. Geisler wrote the following in his book
A Popular Survey of the Old Testament, Baker Book House, Grand Rapids, 1977. He writes:
"Several factors must be kept in mind in viewing this situation. (1) There is a difference between murder and justifiable killing. Murder involves intentional and malicious hatred which leads to life-taking. On the other hand, the Bible speaks of permissible life-taking in capital punishment (Gen. 9
, in self defense (Exod. 22:2), and in a justifiable war (Gen. 14). (2) The Canaanites were by no means innocent. They were a people cursed of God from their very beginning (Gen. 9:25). They were a vile people who practiced the basest forms of immorality. God described their sin vividly in these words, “I punished its iniquity, and the land vomited out its inhabitants” (Lev. 18:25). (3) Further, the innocent people of the land were not slaughtered. The story of Sodom and Gomorrah clearly demonstrates that God would save a whole city for ten righteous people (Gen. 18:22f.). In that incident, when God could not find ten righteous people, He took the four or five righteous ones out of the place so as not to destroy them with the wicked (Gen. 19:15). On another occasion God saved some thirty-two thousand people who were morally pure (Num. 31:35). Another notable example is Rahab, whom God saved because she believed (cf. Heb. 11:31). (4) God waited patiently for hundreds of years, giving the wicked inhabitants of Canaan time to repent (cf. 2 Peter 3:9) before He finally decided to destroy them (Gen. 15:16). When their iniquity was “full,” divine judgment fell. God’s judgment was akin to surgery for cancer or amputation of a leg as the only way to save the rest of a sick body. Just as cancer or gangrene contaminates the physical body, those elements in a society—if their evil is left to fester—will completely contaminate the rest of society. (5) Finally, the battle confronting Israel was not simply a religious war; it was a theocratic war. Israel was directly ruled by God and the extermination was God’s direct command (cf. Exod. 23:27-30; Deut. 7:3-6; Josh. 8:24-26). No other nation either before or after Israel has been a theocracy. Thus, those commands were unique. Israel as a theocracy was an instrument of judgment in the hands of God. source
Not having any understanding of the above, you presume to be more moral than God whom you accuse of murder.