Even though some of the kings of Judah did not follow the ways of David, God kept His promise to David that his descendants would rule. God puts up with a lot of crap to keep His promises. His mercy is unending.
Of course, Jesus was in the bloodline of David and ultimately became the King God was referring to.
READ/HEAR: 2 Kings 8,9