To answer this question, I must look to see what God has said about this. The complete statement from God is this:
The Lord passed before him and proclaimed, "The Lord, the Lord, a God merciful and gracious, slow to anger, and abounding in steadfast love and faithfulness, keeping steadfast love for thousands, forgiving iniquity and transgression and sin, but who will by no means clear the guilty, visiting the iniquity of the fathers on the children and the children's children, to the third and the fourth generation." (Ex 34:6-7)
The background of this is important. God gave the Ten Commandments to Moses on Mount Sini and even before Moses had a chance to give them to the people, they had made a golden calf-idol, started worshiping it, and indulged in other sinful activity. They knew this was wrong even though the Ten Commandments had not yet been given. When Moses saw it, he broke the two tablets containing the Ten Commandments. After Moses stopped the riotous worship, God then told Moses to make two more tablets and bring them back up the mountain. This is when God spoke the above verses to Moses on Mount Sini.
Before making any mention of visiting sins, God makes it very clear that he is merciful … forgiving … etc. You can’t read the second part without fully absorbing the first. This people had just committed the most grievous sins ever. They had seen God’s direct intervention on their behalf when he brought them out of Egypt and yet they quickly turned and worshiped a golden idol that they had made with their own hands. The even declared it was the god that brought them out of Egypt. Now, God lets Moses know how forgiving he is. He isn’t going to destroy the whole nation though they deserve it.
It is also important to note that after this, the people continued to be disobedient to God’s commands. They refused to enter the Promised Land when first told to go in. God then made them wander in the desert for forty years until this rebellious generation (people over twenty years old) had died off. This is the way God punished them for their sins. What did he do to the children? Those who were twenty years old or younger? He led them into the Promised Land. They experienced God’s blessing as they took the land and occupied it. They followed the Lord’s commands and prospered. God did not punish the children for their father’s sins. He was gracious and showed his steadfast love to them.
This dramatically shows that what God said in visiting the iniquity of the fathers on the children to the third and fourth generation didn’t mean he was going to cause them to sin or punish them for their father’s sin. In addition to this, God clearly made a statute that children were not be put to death because of their fathers or fathers because of their children (Deut 24:16). Therefore, we must try to understand what God meant about visiting sins to other generations.
One of the simplest explanations is that children often learn the bad habits of their parents. It doesn’t always happen, but smokers, drinkers, cursers, adulterers, and the like often have kids who do the same. These kids reap the consequences of their actions just as their parents do.
God made us to be imitators. His original design was for us to imitate him in holy living. However, because of the fall, we tend to imitate people. God knows this all too well and his statement about visiting sins is more about knowing that we tend to repeat the sins of previous generations. When you read the book of Judges in the Bible, you will see that this first generation followed the Lord. When that generation had died out, their children started imitating the nations around them and worshiped idols, just has their grandparents who died in the desert had done.
This may sound very fatalistic, but we must remember what God said about being forgiving. In the book of Judges and on to the time of Jesus, various generations followed God and others went astray. Now, we have Jesus to imitate instead of sinful ancestors. Jesus gives us the ability to live godly lives by giving us his Holy Spirit to live in us when we turn to him in repentance for our sins and ask for forgiveness. The Holy Spirit working in us gives us the power to break the tendency to imitate sinful ancestors.