If one thing is clear, not one king was perfect; not even David. But . . . David had a heart for God and he was God’s friend.
Rehoboam, David’s grandson, was almost solely responsible for splitting Israel into the Northern and Southern Kingdoms. But when God turned up the heat on him, he humbled himself and God was pleased with him for doing so.
Asa, Rehoboam’s grandson, started well; “He commanded Judah to seek the Lord.” But, “Although he did not remove the high places from Israel, Asa’s heart was fully committed to the Lord all his life.”
Of Jehoshaphat, Asa’s son, it says, “The Lord was with him because in his early years he walked in the ways of David.” And in spite of a mis-step it says, “There is, however, some good in you, for you have rid the land of the Asherah poles and have set your heart on seeking God.”
When informed of approaching armies, “Jehoshaphat resolved to inquire of the Lord. We have no power to face this vast army. We do not know what to do, but our eyes are on you.”
“The Lord is with you when you are with him.” And the Lord was so with them, that he turned the armies against each other so that all Judah had to do was collect the plunder. It took 3 days.
God is not as interested in our perfection as he is in our affection.