The reign of King Jehoash is marked by a dramatic spiritual turning point, splitting his life into a period of absolute loyalty to God followed by a tragic collapse. Despite this catastrophic end, he remains part of an exclusive group of only seven kings from the House of David who are recognized for doing what is right in the eyes of God [אדרת אליהו].
The primary approach among commentators is that his righteousness was strictly limited in time. Jehoash did not maintain his devotion throughout his entire life, but only during the years when Jehoiada the priest was alive to teach and guide him. Once his mentor passed away, the king lost his way and his actions became corrupt. The root cause of this downfall was a lack of internal conviction. Jehoash never truly absorbed the spiritual path for himself; his good behavior was merely the result of obeying external instructions. Because he acted out of compliance rather than acquiring deep, personal wisdom, his righteousness collapsed the moment his teacher was no longer there to guide him [מלבי״ם].
This spiritual collapse took the form of a severe and highly unusual sin. Immediately after Jehoiada's death, the leaders of Judah approached the king with heavy flattery, ultimately treating him as a deity and bowing down to him. They convinced him of his divine status with a compelling argument: the High Priest enters the Holy of Holies only once a year and faces the constant threat of death, yet Jehoash hid in that sacred space for six entire years and survived. To them, this proved he was worthy of being worshiped as a god [רש״י, צאינה וראינה].
Rather than viewing this as an act of sheer arrogance similar to Pharaoh, a deeper perspective suggests that Jehoash was led astray by a flawed thought process. He believed that because God had chosen him, protected him in the Holy of Holies, and placed him on the throne, it must be His will for the king to serve as a literal divine representative on earth [נחל שורק, חומת אנך].
Offering a surprising contrast, another viewpoint argues that Jehoash never actually violated any of his mentor's instructions. Jehoiada had thoroughly trained the king to avoid worshiping idols or the forces of nature, but it never crossed the priest's mind to warn his student against turning himself into a god. Consequently, the king's grave error was born out of foolishness and impulsiveness when faced with the leaders' flattery, regarding a subject that was simply never covered in his lessons. In this light, Jehoash genuinely did what was right concerning everything his teacher actually taught him [אהבת יהונתן].