Every religion always uses a set of code/morals to persuade people into believing that their religion brings good to the world. The following Commandmends were writen in the Book of Dead (2000 BC), if you read closely you will notice that they sound very familiar to the Judeo-Christian's version in the Bible. Just replace "I have not" to "Thou shalt not"
I have not committed sin.
I have not robbed.
I have not killed men.
I have not plundered the property of God.
I have not lied.
I have not defiled any man's wife.
I have not defiled myself.
I have not cursed the king.
I have not acted deceitfully
I have not turned a deaf ear to the words of the Law (or Truth)
One thing to note about the 8th comandment, is that one must understand that the king was considered to be a God himself. That is the reason why they build elaborate tombs/pyramids to house the bodies of their Kings.
When the Bible was written, there were other religions being practiced throughout the region. I think that it was very important for them to write stories that shared similar traits to what other religions were doing. It makes it easier to convert people. This is why there are so many "pegan" references in today's Christianity.