In Psalm 51:4, David says, "Against you, you only, have I sinned." Why would David say these words when he obviously sinned against others?
Your question is one many have asked. This passage is part of David’s cry of confession and plea for restoration after he took Bathsheba unlawfully and had her husband Uriah killed. David’s sins of murder and rape which resulted later in the death of his child were dark, egregious sins.
I don’t think for a minute David was avoiding his responsibility for these dark acts or in any way ignoring his obvious sins against Bathsheba and Uriah. But in this prayerful confession, he had to get to the core of his sin so that he could be restored in soul, spirit, and mind. Sin holds a posture of defiance toward God’s commands; it is an assault on God’s authority. One Bible scholar notes that sin is primarily about “assaulting the glory of God, rebelling against God...a vertical phenomenon.”
Too often we confess our sins toward others without fully understanding our offense against God. Although David failed miserably, he was known as a man after God’s own heart (1 Sam. 13:14; Acts 13:22). He always returned to his earnest love for God. He always repented and understood his failure before God and reset his life toward Him. David knew that he couldn’t live long with the separation from God, caused by sin.
So, when David said, “Against you, you only, have I sinned,” he was acknowledging his rebellion against God. He was asking forgiveness for his dismissal of God’s commands. As commentators have noted, when Nathan came to David he said pointedly, “Why did you despise the word of the LORD by doing what is evil in his eyes?” (2 Sam. 12:9).
David knew that the worst thing he had done was to despise God. He was not minimizing his crimes against others. Rather, he was emphasizing the direct assault on God that he had caused with those acts.