God told Jehu to finish off Ahab's family to wipe out Baal worship in Israel. Elisha the prophet had sent a young prophet to anoint Jehu king and "destroy the house of Ahab" [2Kings 9]. He also killed all the Baal prophets of Jezebel and demolished the temple of Baal, reducing it to a mere toilet. But Jehu went further and killed even the associates and friends of Ahab. It was a disobedience.
"However, Jehu did not carefully keep the law of God, Israel's God, heartily--he didn't repent from Jeroboam's sin, which the latter made the whole of Israel to commit," [10.31]. Years later God punished the house of Jehu and Israel for the Jehu overkill, the "massacre" at Jezreel [Hosea 1].
So what made him do it? He was doing well, obeying God's Word by putting an end to Ahab's house and rule, but he over did it. Power can corrupt like that. And what made the kings of Israel helpless to power's corruption?
ANSWER: It was the sin of Jeroboam, son of Nebat. God particularly stressed that Jehu's sin was that he never repented of Jeroboam's sin, though he eliminated Baal worship in his time. The sin of Jeroboam son of Nebat was much worse then than Baal worship and the sins of Ahab and Jezebel combined. The sin of Jeroboam is deadly. And today, that sin eats at the heart of the modern church. The church should repent from the sin of Jeroboam, which he caused Israel to commit generations after generations.
That sin makes churches over do things. An over kill, so to speak. They stray from God's Word and ways and then over do things. Initially, churches (especially new churches) do God's will with all their hearts. They all start out right. But then, they start to worry too much later on, worrying about membership, church income, why their members seem to be going to other churches. Then they become paranoid about how they might lose their members and have no one left to them.
That was how King Jeroboam worried about his kingdom. He started to be creative with his gimmicks on how to up his "membership" and how to make things fun and easy for his members so they'd "keep going back to church each Sunday." He began prioritizing the needs of his church members, rather than focusing on what God wanted.
Once you start worrying about membership and focus on the needs of your members and denominational expansionism, you over do things, you over kill, and you are trapped in the sins of Jeroboam. That sin is much worse than occultism, witchcraft, or idolatry rolled into one.