2 Kings 18:3 (NKJV)
And he did what was right in the sight of the Lord, according to all that his father David had done.
2 Kings 21:2 (NKJV)
And he did evil in the sight of the Lord, according to the abominations of the nations whom the Lord had cast out before the children of Israel.
2 Kings 21:20 (NKJV)
And he did evil in the sight of the Lord, as his father Manasseh had done.
2 Kings 22:2 (NKJV)
And he did what was right in the sight of the Lord, and walked in all the ways of his father David; he did not turn aside to the right hand or to the left.
These four verses are about four kings in succession. Hezekiah was good, Manasseh his son was bad, Amon the grandson was bad, and then Josiah the great-grandson of Hezekiah was good. The judgment on the reign of these kings was predicated on whether they followed the ways of King David or whether they followed the ways of the pagan nations that surrounded them. King David loved God with all his heart; you can tell that by reading the Psalms and by his desire to keep the commands of the Lord. These bad kings followed after other Gods. They were religious; they worshiped false gods--gods that put no restraints on their wickedness.
We all serve a master, good or bad; we are all slaves, either to righteousness or to sin. Being a slave to sin means you are not free to do what is right. Being a slave to righteousness means you are not free to do what is wrong. Turn that around and being a slave to sin means you have the freedom to sin all you want but being a slave to righteousness means you have the freedom to do what is right!
Romans 6:17-18 (NKJV)
But God be thanked that though you were slaves of sin, yet you obeyed from the heart that form of doctrine to which you were delivered. And having been set free from sin, you became slaves of righteousness.