Because it's right. Does your moral code really reduce to "do whatever the authority figure tells you to"?
What makes it right? If the "authority figure" is God, then yes.