Here's what God says about this:
Mark 10:4-5
They said, "Moses permitted a man to write a certificate of divorce and send her away." "It was because your hearts were hard that Moses wrote you this law," Jesus replied.
So God tells them directly, that Moses and the other prophets gave commands that were, not from God, but from men. He gives the reason for that here also. It was, because of the hardness of their hearts.
God's moral code is objective and the same code can be uncovered by men. It is because they are in the image and likeness of God. The objectivity of the code is found in the nature of man and of God, because both are of the same likeness.