Standing before his Creator, King David asks to be judged from a divine perspective. Rather than focusing solely on his visible failures, he yearns for an evaluation that considers his entire being, his inner intentions, and his merits. This plea reflects a deep desire for a judgment rooted in kindness, truth, and a true understanding of the human heart.
The primary approach among commentators understands this plea as a prayer to avoid harsh justice. David asks that the sins he committed, which rightfully make him deserving of punishment, be entirely removed from God's presence so they are not brought to trial at all [רש״י, מצודת דוד, מאירי]. Some specifically connect this request to the incident involving Bathsheba. They view it as a desperate plea for the judgment he deserves for that specific wrongdoing to be erased and forgotten [רד״ק, חומת אנך, מאירי]. Following this line of thought, David asks God to focus exclusively on his good deeds and upright actions, judging him solely by his merits while completely overlooking his transgressions [רש״י, רד״ק, מצודת דוד].
In contrast, other commentators interpret David's request as a desire for his judgment to be fully brought to light and clarified [מאירי, ביאור שטיינזלץ, אבן עזרא]. He asks that his fate be decided strictly by God rather than by human beings. While people often distort justice and are quick to condemn, God's judgment is always perfectly fair and honest [מלבי״ם].
According to this perspective, the focus on uprightness points to sincere, inner truth. Divine justice does not merely look at external actions, which might appear problematic to an observer, but penetrates the deeper thoughts and desires of the heart [אלשיך, ביאור שטיינזלץ]. Because of his elevated royal status, David is held to an exceptionally strict standard; a regular person would not face the same level of blame for similar actions [אלשיך]. David maintains that God sees the true uprightness in his heart and knows the reality of the situation. While the events with Bathsheba may look highly improper from the outside, God knows the hidden truth: Bathsheba was actually a divorced woman, and God Himself had preordained that David would face this complex moral test. Therefore, David asks God to look past the superficial appearance of the event, examine his inner motives, and justify him based on this complete divine knowledge [חומת אנך].