You must remember that God as the author of life has some rights that we as humans do not have. If he should decide to end my life than he has the right where us mere mortals have not.
So I think in the biblical context the Israeli's who where commanded to kill where doing the bidding of God and not murdering of their own will.
As I have mentioned in a similar thread when God gives you a command it becomes your moral duty to perform the action and to go against it would be sinful.
I hasten to add that we should not easily accept it when people do bad things and say "God told me to do x, y and z."
These where isolated events in the Old Testament and where not the common way for God to operate. These events where always in tune with God's nature.
It is interesting to note that God postpone his people's return to their holy land for the inequity of the Canaanites was not complete. He sent his people into slavery for 400 years because the Canaanites where not yet wholly corrupt
A few quotes from this article
13 And God said to Abram, "Know for certain that your descendants will be strangers in a land that is not theirs, where they will be enslaved and oppressed four hundred years. 14 But I will also judge the nation whom they will serve; and afterward they will come out with many possessions. 15 And as for you, you shall go to your fathers in peace; you shall be buried at a good old age. 16 Then in the fourth generation they shall return here, for the iniquity of the Amorite is not yet complete."
- Just How Bad Were The Canaanites?
Until about 1930 most of what was known of the ancient Canaanites was what could be gleaned from the Bible. This is when archeologists discovered the Ras Shamra religious epic literature from Ugarit in North Syria. Thousands of clay tablets stored in what seems to be a library between two great Canaanite temples dating from the fourteenth or fifteenth century B.C. give a full description of the Canaanite religion.
Much of what was unearthed in this library would be "X-rated" even by today’s standards. The New Unger’s Bible Dictionary gives a sanitized description of "lewd nature worship with immoral gods, prostitute goddesses, serpents, cultic doves, and bulls. El, the head of the pantheon, was the hero of sordid escapades and crimes. He was a bloody tyrant who dethroned his father, murdered his favorite son, and decapitated his daughter. Despite these enormities, El was styled "father of years" (abu shanima), "the father of man" (abu adami, "father bull"), i.e., the progenitor of the gods. Baal, the widely revered Canaanite deity, was the son of El and dominated the Canaanite pantheon. He was the god of thunder, whose voice reverberated through the heavens in the storm. He is pictured on a Ras Shamra stela brandishing a mace in his right hand and holding in his left hand a stylized thunderbolt. The three goddesses were Anath, Astarte, and Ashera, who were all three patronesses of sex and war. All were sacred courtesans. Other Canaanite deities were Mot (death); Reshep, the god of pestilence; Shulman, the god of health; Koshar, the god of arts and crafts. These Canaanite cults were utterly immoral, decadent, and corrupt, dangerously contaminating and thoroughly justifying the divine command to destroy their devotees."(3) "
The Cannanites where bad and it was God's prerogative to judge them. The only problem is that we have God using humans to enact his judgement, but as divine law theory teaches when God gives you a command it becomes your moral duty to do said thing.
He is not being morally unjust becuase he has the right to take the life of humans as he sees fit.