Every person does indeed have equal value because we are all created in His image. However, God is not just a creator, but a sustainer of his creation. Thought it sounds unjust and barbaric to kill other people, we must understand that God only orders the taking of lives to protect his people. Listen to what is recorded in the book of Deuteronomy (12:29-32) about some of the other nations surrounding the Israelites at the time:
“When the Lord your God cuts off before you the nations whom you go in to dispossess, and you dispossess them and dwell in their land, take care that you be not ensnared to follow them, after they have been destroyed before you, and that you do not inquire about their gods, saying, ‘How did these nations serve their gods?—that I also may do the same.’ You shall not worship the Lord your God in that way, for every abominable thing that the Lord hates they have done for their gods, for they even burn their sons and their daughters in the fire to their gods."
These nations worshipped false gods and even threw their own children into fire to appease them! This is why Israel was justified in defending itself and executing the judgment of God upon these peoples. I do not believe God is unfair. If the people of these nations listened to their conscience and to the messengers God sent, they would have been spared (see Genesis 18:22-33). Consider what happened in Nineveh when the people repented (Jonah 3:4-10).
Before we make judgments on God, let us consider what we would do it if the people of these nations came after ourselves, our families and our communities. Would we not defend ourselves? Would we just sit there idly? I do not believe so.
For more information, read the following articles carefully (lots of information!):
[Answered by Pastor HM]