With parenting, attitudes are known to have a circular causality. The behavior/attitudes/beliefs exhibited by the parent are passed to the children through a combination of environment and observation, and are then reinforced in the parent through the exhibition of the same behaviors/attitudes/beliefs in their children.
Which is why, in the Old Testament, the sins of fathers (or mothers) were visited upon the children to the third and fourth generation. It isn't that the sins were passed on genetically, or God condemned them to commit the same sins as their parents. A child can only do what they see their parents do, can only think what they hear their parents express.
The parent is the most powerful influence in a child's life. An alcoholic parent passes on addictive behavior to the child, though the irony is the child probably won't pick up the parent's addiction, but find one of their own. Then the next generation will pick up the first addiction, or perhaps another, different one of their own. The cycle has to be broken, which is what God was talking about when He made the pronouncement.