God knows that our actions have far-reaching results. He knows if we have a lax attitude about our relationship with Him---that more than likely our kids will pick that attitude up from us. Let’s say that the first domino is that of a Dad developing the habit of skipping worship services----the second domino is his kid who figures if Dad doesn’t have to go than neither do I---the third domino, a grandchild is then never taken to church…he in turn grows up to be an agnostic---his child might become an atheist----and on and on the domino effect can move into future generations. By the way---we should think about this---while we can make our choices, we don’t get to choose the consequences of our choices…. Getting back to this punishment thing in the second commandment----It’s not that God punishes the second, third and fourth generations for sins committed by the first---it’s that God keeps seeing the same kind of sin being committed in the second, third and fourth generation.
Fortunately the chain can be broken. And the good news is God’s grace is greater than our sin. Over the long haul good will come out on top. That’s what God means when He says He punishes (visits) the sin of the fathers to the third and fourth generation of those who hate me, but shows love to a thousand (generations) of those who love me and keep my commandments.”