1 Kings 15:5

because David did what was right in the sight of the Lord, and had not turned aside from anything that He commanded him all the days of his life, except in the case of Uriah the Hittite.

1 Kings 14:8

and tore the kingdom away from the house of David and gave it to you—yet you have not been like My servant David, who kept My commandments and who followed Me with all his heart, to do only that which was right in My sight;

2 Samuel 11:15-17

He had written in the letter, saying, “Place Uriah in the front line of the fiercest battle and withdraw from him, so that he may be struck down and die.”

2 Samuel 12:9-10

Why have you despised the word of the Lord by doing evil in His sight? You have struck down Uriah the Hittite with the sword, have taken his wife to be your wife, and have killed him with the sword of the sons of Ammon.

1 Kings 9:4

As for you, if you will walk before Me as your father David walked, in integrity of heart and uprightness, doing according to all that I have commanded you and will keep My statutes and My ordinances,

Luke 1:6

They were both righteous in the sight of God, walking blamelessly in all the commandments and requirements of the Lord.

2 Samuel 11:3-4

So David sent and inquired about the woman. And one said, “Is this not Bathsheba, the daughter of Eliam, the wife of Uriah the Hittite?”

1 Kings 15:3

He walked in all the sins of his father which he had committed before him; and his heart was not wholly devoted to the Lord his God, like the heart of his father David.

2 Kings 22:2

He did right in the sight of the Lord and walked in all the way of his father David, nor did he turn aside to the right or to the left.

2 Chronicles 34:2

He did right in the sight of the Lord, and walked in the ways of his father David and did not turn aside to the right or to the left.

Psalm 51:1

For the choir director. A Psalm of David, when Nathan the prophet came to him, after he had gone in to Bathsheba.
Be gracious to me, O God, according to Your lovingkindness;
According to the greatness of Your compassion blot out my transgressions.

Psalm 119:6

Then I shall not be ashamed
When I look upon all Your commandments.

Acts 13:22

After He had removed him, He raised up David to be their king, concerning whom He also testified and said, ‘I have found David the son of Jesse, a man after My heart, who will do all My will.’

Acts 13:36

For David, after he had served the purpose of God in his own generation, fell asleep, and was laid among his fathers and underwent decay;

Treasury of Scripture Knowledge

Summary

Because David did that which was right in the eyes of the LORD, and turned not aside from any thing that he commanded him all the days of his life, save only in the matter of Uriah the Hittite.

Bible References

David

1 Kings 15:3
He walked in all the sins of his father which he had committed before him; and his heart was not wholly devoted to the Lord his God, like the heart of his father David.
1 Kings 14:8
and tore the kingdom away from the house of David and gave it to you—yet you have not been like My servant David, who kept My commandments and who followed Me with all his heart, to do only that which was right in My sight;
2 Kings 22:2
He did right in the sight of the Lord and walked in all the way of his father David, nor did he turn aside to the right or to the left.
2 Chronicles 34:2
He did right in the sight of the Lord, and walked in the ways of his father David and did not turn aside to the right or to the left.
Psalm 119:6
Then I shall not be ashamed
When I look upon all Your commandments.
Luke 1:6
They were both righteous in the sight of God, walking blamelessly in all the commandments and requirements of the Lord.
Acts 13:22
After He had removed him, He raised up David to be their king, concerning whom He also testified and said, ‘I have found David the son of Jesse, a man after My heart, who will do all My will.’