i'm sure i've posted about this before, but i can't find it...
what's my hyper-rationalist, atheistic take on the whole god-telling-abraham-to-kill-isaac story?
unlike much of the old testament, i don't think that this story has a known alpha source. so, for example, the flood story is thought to derive from a much older babylonian myth, and the exodus story might have something to do with the sea peoples. but, this particular story seems to be inherently and originally jewish (or canaanite) in origin - at least, as far as we know.
i've also seen some suggestions that the story may hold a memory of child sacrifice in ancient hebrew culture, and that it was changed due to changing social attitudes. i think this is close, but it perhaps reverses the causality.
my general perception of what the bible is is an elaborate ploy for the existence of the jewish state. there are still bedouins in the region, to this day; these are what the ancestral hebrew populations in the region would have been like. the bible is essentially a fairy tale to try and assert statist control over these nomadic sheep herders. this story is best understood in this context, along with the rest of the bible.
in the modern era, we reject the idea that jews are baby eaters as racist and hateful and trace the history of this exclusionism back through the christian persecution of judaism that supposedly started in the middle ages. but, if you look at the history in more depth, you realize that the roman persecution of judaism is actually largely rooted in the punic wars - and that the romans were calling the carthaginians baby killers hundreds of years before the common era. in fact, carthaginian religion does appear to have had a place for child sacrifice in it, going back to the early part of the first millennium. the carthaginians lived in modern tunisia, but they were semitic migrants from phoenicia that would have been extremely similar to the ancient jews. roman hegemony was built on the destruction of carthage in the punic wars.
carthago delenda est
...and that feeling was still going on, apparently, for quite a while after it actually was.
what i might suggest, then, is that the people that wrote this particular story were living amongst people that were sacrificing their kids to (the) god(s), for whatever reason - to ward off diseases, to maximize the harvest, so that it would rain once in a while in the fucking desert, etc - and that there was an intent underlying writing it to teach the people to stop fucking do it. it might not even have been particularly moral.
there is evidence of child sacrifice in italy fairly late into antiquity, as a consequence of the calamity that resulted from the onset of the european dark ages. these people were sacrificing their children to their pagan gods in order to stop the collapse of their society - something that was of course foolish, and ultimately would have merely led to lower population growth. it would have been hard for the romans to compete with the invading germans, let alone with the accursed christians, if they were murdering their own children to curry advantage with their imaginary gods. as terrible as the twin threats of christianity and german barbarism no doubt were on the late empire, milesian thought had clearly left these people, as well.
years later, the byzantines would open the gates to the turks because they thought jesus would come back after they did. the turks just laughed at them; that was the end of the byzantines. it's really amazing how religion can weaken and destroy a culture and lead it to cannibalize itself...
but, whether due to moral teaching, or just due to the elite trying to maximize population growth, perhaps even for war, my guess is that the intent of the story is to teach these bedouins to stop sacrificing their own kids - that if they must sacrifice something, they should kill a fucking goat instead.