Genesis 39 · a question people ask
Why does Joseph call it a sin against God, not only against his master?
Joseph names both. Against his master it would betray a trust: "he has not kept back anything from me but you, because you are his wife" (39:8-9). And he says, "How then can I do this great wickedness, and sin against God?" (39:9). Psalm 51, whose title (part of verse 1 in the World English Bible) sets it "when Nathan the prophet came to him, after he had gone in to Bathsheba", speaks the same way: "Against you, and you only, I have sinned" (Psalm 51:4).
The verses
“But he refused, and said to his master’s wife, “Behold, my master doesn’t know what is with me in the house, and he has put all that he has into my hand. No one is greater in this house than I am, and he has not kept back anything from me but you, because you are his wife. How then can I do this great wickedness, and sin against God?””
“For the Chief Musician. A Psalm by David, when Nathan the prophet came to him, after he had gone in to Bathsheba. Have mercy on me, God, according to your loving kindness. According to the multitude of your tender mercies, blot out my transgressions.”
“Against you, and you only, I have sinned, and done that which is evil in your sight, so you may be proved right when you speak, and justified when you judge.”