Question: David is called a man after God’s own heart, yet we know of his adultery and schemes to have Uriah murdered. How is this reconciled?
Answer: Like Saul, David fell into sin (spurred, no doubt, by arrogance). Saul tried to shift the blame to others when confronted by Samuel (1 Samuel 13:1-15). David, on the other hand, when confronted by Nathan, broke down in contrition and repented (2 Samuel 12:1-14). His psalms about this time (32 and 51) indicate that he was struggling with guilt and remorse all the time up to this point. This indicates that he had a heart after God’s heart, and that he felt the separation from God as painful, unlike Saul, who just seemed to be upset about how others would perceive him.
The phrase, “a man after God’s own heart” is meant to describe the general tenor of David’s life, rather than a specific period in his life when he was definitely not acting in accord with God’s heart. God looks at our lives as a whole and not just in terms of the bad parts. Abraham was described by God as having unwavering faith (Romans 4:20), yet we know that his faith momentarily wavered at times (when he lied about Sarah being his wife, twice, and when he produced a child through Hagar). But the general tenor of his faith was unwavering, and that is what God graciously comments on.