A king's decisions shape not only his own life but also his place within his family's history. By choosing to return to a pattern of sin, a leader breaks away from the path of goodness and aligns himself with the dark legacy of his dynasty. Rather than forging a righteous path, the king chose to imitate the actions of his ancestors who did evil in the eyes of God.
There are different ways to understand exactly which ancestors he imitated. One perspective points directly to his recent predecessors, the kings Manasseh and Amon, suggesting an immediate connection to their wrongful actions [מצודת דוד]. A broader view sees his behavior as a reflection of a much larger family history of wickedness. In this light, he follows in the footsteps of all his sinful ancestors, joining a long line of kings like Ahaz, Manasseh, and others who chose a similar path of wrongdoing [רלב״ג].