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.
Does this verse mean that the only serious sin David did was the sin of adultrey and plotting to kill Uriah, or does it mean something else? Its hard to interpert, because David did some other actions that dont seem right either (like certain actions in war like killing captives, other actions in 1st Samuel 27).