This "divine command theory" is what many self-styled sophisticated theologians argue for, but it's clearly not an argument that supports objective morality – morality becomes based on the subjective and contextually relative commandments of God.
But what about God's own behavior? It's often pointed out that God, in addition to commanding many horrible things, did many horrible things. He 'hardens the heart' of the Pharaoh, then punishes his stubbornness by murdering all of the Egyptians' firstborn children. When people behave badly, he sends a great flood and kills them all. In the story of Job, God kills Job's family on a bet. When one of his prophets is taunted by some kids, he sends a pack of bears to maul the kids to death. And if you have the wrong theology, God is going to send you to a very bad place forever and ever.
But recall what William Lane Craig said in his debate with Sam Harris:
"God's own holy and loving nature provides the absolute standard against which all actions are measured. He is by nature loving, faithful, generous, kind, and so forth."
"God's moral nature is expressed to us in the form of divine commandments. Far from being arbitrary, God's commandments must be consistent with his holy and loving nature."Now, here's Craig claiming that God isn't subject to his own commandments:
Since God doesn’t issue commands to Himself, He has no moral duties to fulfill. He is certainly not subject to the same moral obligations and prohibitions that we are. For example, I have no right to take an innocent life. For me to do so would be murder. But God has no such prohibition. He can give and take life as He chooses. We all recognize this when we accuse some authority who presumes to take life as “playing God.” Human authorities arrogate to themselves rights which belong only to God. God is under no obligation whatsoever to extend my life for another second. If He wanted to strike me dead right now, that’s His prerogative.Craig's stumbling over his own feet, plainly contradicting himself. If God's commandments are expressions of his holy and loving nature, then to do things contrary to his commandments would be to act against his own nature. In this sense, God cannot choose to do evil things, for that would be in defiance of his very nature. If we take this to its logical conclusion, it means that for God to murder the firstborn of the Egyptians, or to send bears to maul smart alec children, etc. etc., are not intrinsically evil acts. Whether or not they're evil depends on whether God does them, or commands them. That is, by definition, a subjective and contextually relative form of morality.
All this goes to show that theist arguments for "objective morality" are a bunch of crap. Theism does not provide, as Craig claims, a sound foundation for objective moral values. And the God of the Bible, through such atrocious acts of wanton cruelty, condemns himself.