I like this explaination, so I'll cut and past, it's from intrnetinfedels www.infidels.org/library/magazines/tsr/1994/1/1idol94.html
When we start justifying evil to preserve our worship of biblical inerrancy, or any doctrine, then we debase our whole system of values. Our hearts and minds become warped, numb to atrocity, blind to evil, and we become the perfect cannon fodder for the next Hitler. The man or woman who can view the children of any age as evil, who can discover no solution other than killing them all, is not to be trusted with anything more dangerous than a squirt-gun... or any office higher than dogcatcher. A Stone Age deity, of course, can get away with such things, being little more than a stand-in for the random, fearful forces of nature. Thus, the gods of primitive peoples, including the storm-god of the Old Testament, were potential killers to be feared and placated with sacrifices. When a village was wiped out by volcano or flood, everyone assumed that their god had been angered or provoked in some manner. What else could they believe? Scientific enlightenment had yet to overtake superstition. When they lost a battle, everyone assumed that they were being punished by their god for some indiscretion. The job of their priests was to identify the provocation, correct it, and thus humor their god. Keeping their gods in good humor or sustaining them in symbolic ways (as did the Aztecs) was the all-important job of the ancient priesthood. Happy gods meant happy times; angry gods sent disaster. If you read between the lines of the Old Testament, you can see this type of rationalization constantly at work.
It never occurred to the ancients, therefore, to question the morality exhibited by their gods. The fearful forces of nature spoke powerfully... and man listened. Who could question the power of lightning or the thumping of giant hailstones or the strength of floods? It never occurred to the ancients that a truly powerful god would not have to act in such clumsy ways, for nature was the only god they knew. It never occurred to the ancients that a truly wise and powerful god would communicate face to face with each man or woman rather than through nebulous dreams, divinations, or (later) scriptures. The gods of nature never spoke openly but rather in whispers and dreams and omens, or so the ancients perceived. It never occurred to them that their god should be concerned with the well being of all peoples, includ in those days were tribal gods, including Yahweh. They concerned themselves only with their particular tribes.
Thus nature was the only god the ancients knew, and their gods spoke in terms of earthquakes, floods, epidemics, volcanic eruptions, droughts, fertility, good crops and bad crops, victory and defeat. Thus, the gods acted in strange and powerful ways for good and evil, and it was of the utmost importance to divine their will and placate them. The Hebrews had their magic "dice," the Urim and Thummim, and the study of animal livers was practically an industry in that part of the world. God's strange methods were not to be questioned, but they might be divined with profit.