Its wrong to see the bible as a strictly historical document, just as it is wrong to see the bible as a science book. In essence its a theological expression of a Jewish religion that used stories mixed with both history, allegory, myth, and parable, in order to express their understanding of God, the source of their religion. And what we see in the bible is a continual development of their understanding of the concept of God, both morally and ontologically. We see a history of man grappling with the idea of God. Yes there is history, but there is also exaggerated myths, some of which when taken literally do not really correspond to Gods true nature but are used none the less to express Gods power and sovereignty as they understood it at the time. How much God cares for Israel is depicted in the sense of God ensuring their victory over their enemies. In ancient times, kings and queens expressed their absolute power, by mercilessly killing men women and children. The concept of wiping out a whole race of people, when seen in its proper context, seem to the author at the time to be a good way of showing how powerful the Jewish God has made Israel and how his favor rests with them over all nations. Its unfortunate that he used that idea. But the people of his time understood what he meant by that literary device in so far as it displayed a popular sense of power. However, as the bible develops we see how the depiction of Gods character changes.
The old testament depiction of God was largely a warrior God protecting the Israel people and commanding them to dispatch the enemy. We know that in real history that the Canaanites were not all wiped out; and there is no real evidence that a city called Sodom and Gomorrah was destroyed, at least not in the way depicted in the bible. So we cannot really take these stories as historical documents, but rather as the theological expression of the war on sin. Notice that Stories of great floods or wars or destructions of cities are always depicted in the sense of getting rid of “sin”. If you look at it in a theological sense, then i think it would be more accurate to view these stories as allegories depicting how much God hates sin, and that sin brings destruction, which is depicted as God bringing his terrible wrath, through floods and saving that which is holy and good, etc. *
God never commanded the human sacrifice of Abraham’s son; and those people who take the story literally, miss the point. There are many dimensions to this story that are revealed when you see it for what it is. At the end of the story God is depicted as saying to Abraham not to sacrifice his son, and the author concludes the story by saying that Abraham had great faith in God. In other words the story really isn’t about sacrificing children. That is merely a tool which the author uses in order to make his point. The main point the author is trying to make is that we should always have faith that God would never lead us astray; we should never question the good of God. This is a point which is evidently expressed when God tells Abraham to stop the sacrifice, revealing the fact that God is good and would never command us to kill our children like the “pagans” and other nations in that time who were practicing that evil act. So not only does the story teach us about having faith in God’s goodness, but it is also a moral attack on “human sacrifice”. Also there are other theological dimensions; such as the idea that you should love God more than your most treasured possession, and be willing to make sacrifices for God. But the author is certainly not trying to say that if God told us to do evil, that we should do it. But rather he is telling us that God would never tell us to do evil, and that we should trust the good of God. *