How could David be called 'A man after God's own heart'?
The Prophet Samuel labeled David a man after God's own heart (1 Samuel 13:14). The Apostle Paul seconded this notion by referencing that statement approvingly (Acts 13:22). But these statements stand in obvious tension with other things that we know about David. He committed adultery and murder (2 Samuel 11-12) and was a man of war (1 Kings 8:19). What gives?
One way to quickly resolve the matter is to suggest that David WAS a man after God's own heart at the time of the statement, but then subsequently was NOT a man after God's own heart. Indeed, the statement was made about David very early in his life. While this is the easiest solution to the problem, I don't think it is the best one because there are other references that seem to indicate that David maintained this reputation throughout his life (1 Kings 8:17-18, 11:4).
I want to suggest three reasons why the phrase "a man after God's own heart" is appropriate as a general truth about David:
First, we need to note that the phrase itself implies imperfection. To be "after" God's heart means you haven't yet arrived at possessing God's heart, right? David certainly had days where he temporarily abandoned his pursuit of God, but the overall flow of his life was clearly in the right direction. God does not judge us by our weakest moments, but by our broader trajectory.
Second, I believe "heart" is the most important of words in the phrase in question. David (as we see especially in the Psalms, but in the narrative sections as well) was one who routinely poured his heart out to God in intimate and prayerful conversation. He pursued an authentic relationship with God. He put all his cards on the table, so to speak. When confronted with his most heinous sins, he repented (1 Samuel 12:13), went to prayer (12:16), and accepted the consequences (12:18-23). It was his pattern to invite God to search his heart, identify sin, and lead him to righteousness (Psalm 139:23-24).
I want to focus on the word "man" to make my third point about David. As a king, David was a military man who shed much blood. Indeed, because of all this bloodshed, God said he was not the right man for the job of building the Temple (1 Chronicles 22:8). But at a personal level... as a man... David was about as non-violent a character as we find in the Old Testament. Saul consistently tried and failed to have David killed. David had motive and opportunity to kill Saul, but refused. I believe this personal non-violence resonates very well with what we see in Jesus Christ, and, therefore, the heart of God.
In sum, David was surely an imperfect man. But he was also a man who regularly poured out his heart to God. He stayed in relationship with God even when he stumbled and his treatment of Saul demonstrated the enemy-love that Jesus both taught and exemplified. He may rightly be called a man after God's own heart.