After briefly sketching the faith of Rahab at Jericho, the author of Hebrews, most likely the apostle Paul, realizes that he cannot tell the tale of every faithful individual from the Old Testament, so he begins merely to name them in roughly chronological order. He quickly lists four judges, then lumps David, Samuel, and the prophets in another group before recounting their and others' exploits for God.
We know David primarily as a warrior and king. We realize that he was also "the sweet psalmist of Israel" (II Samuel 23:1). Less often do we, as Paul does here, rank him among the prophets, as does Peter in his Pentecost sermon in Acts 2:29-31. However, Paul's grouping of David with Samuel—who was a prophet and a judge—and the rest of a larger group of Old Testament prophets should be no surprise; for beyond his historical exploits and the lessons we can learn from his full and complex life, his most lasting contribution may well be the numerous prophecies that he wrote down for our learning (Romans 15:4).
It is intriguing to note that Paul chose to place David at the head of this second group of names, out of chronological order and ahead of Samuel. Was this purposeful or just his stream of consciousness? If purposeful, it may indicate that Paul considered David the greatest of the Old Testament prophets, or at least eminent enough to head the list.
Whatever Paul's reason, the fact that David appears with Samuel and the prophets, as well as his inclusion in this Faith Chapter, argues that he conforms to the themes that Paul is expounding. He, too, lived a life of righteousness and faith in firm hope of receiving God's glorious promises in His future Kingdom. Though his conquests and reign established the Golden Age of Israelite history, he yearned for God's direct rule over, not just Israel, but the whole earth.