It was once a highly accepted custom to take revenge on the entire family of a criminal. However, the king actively chose to break from this practice and avoid collective punishment [ביאור שטיינזלץ]. Instead of executing the children of the guilty parties, he governed his actions strictly by the laws written in the Torah. The specific mention of the Book of Moses serves to clarify exactly where this guiding legal standard originates [מצודת דוד].
The fundamental rule is that one generation cannot be penalized for the crimes of another. Fathers are not put to death because of the sins of their children, and children are not executed for the wrongdoings of their fathers [מצודת דוד, ביאור שטיינזלץ]. Justice requires absolute personal responsibility. Anyone who faces the death penalty is executed solely for their own individual actions, and never as a consequence of a crime committed by someone else [מצודת דוד].