In this article it talks about that God doesn't really punish the children for their grandpa sins.
There is a verse (in a couple places in the Old Testament) that says God would visit, "the iniquity of the fathers on the children, and on the third and the fourth generations." The verse in question is actually part of the ten commandments, so it must be pretty important in God's eyes. However, doesn't it seem rather severe to punish innocent great grandchildren because their great grandfather committed some sin? Skeptics claim that this verse shows that God is not fair.
Commandment against idols
First, let's look at the passage in context, so we can see what it really says:
'You shall not make for yourself an idol, or any likeness of what is in heaven above or on the earth beneath or in the water under the earth. 'You shall not worship them or serve them; for I, the LORD your God, am a jealous God, visiting the iniquity of the fathers on the children, and on the third and the fourth generations of those who hate Me, but showing lovingkindness to thousands, to those who love Me and keep My commandments. (Deuteronomy 5:8-10) or (Exodus 20:4-6)
The first thing that we notice is that this is not just any old sin, but the sin of idol worshiprejecting God and worshipping a counterfeit. The second thing we notice is that these children, grandchildren, and great grandchildren are not quite so innocent. In fact, the text says quite clearly they represent "those who hate Me." In other words, these children, grandchildren, and great grandchildren hate God and have followed their fathers into idolatry. So, there is a good reason for God's punishment. The verse is really an admonition for parents. Children will follow in your footstepswhether you do good or evilbased upon your actions, but not necessarily your words. Do not lead your children astray!
Skeptics usually do not quote the next verse in the passage, because it shows the difference in treatment of the God haters versus the God lovers. That contrast is that those who follow God are showered with His loving kindness. This verse confirms that those who are punished are not innocent, but the children, like their fathers, are haters of God and His laws. If you hate God, He will punish you. But if you love God, He will love you and show you His kindness.
Children are not punished for the sins of parents
The Bible is also clear that children are never punished for the sins of their parents:
"Fathers shall not be put to death for their sons, nor shall sons be put to death for their fathers; everyone shall be put to death for his own sin." (Deuteronomy 24:16)
"The person who sins will die. The son will not bear the punishment for the father's iniquity, nor will the father bear the punishment for the son's iniquity; the righteousness of the righteous will be upon himself, and the wickedness of the wicked will be upon himself. (Ezekiel 18:20)
These commands stand in stark contrast to the earlier laws of the Babylonians, such as the code of Hammurabi, which routinely specified death to children because of the actions of their parents.
Conclusion
The context of the verse shows that God does not visit, "the iniquity of the fathers on the children, and on the third and the fourth generations" without good cause. The justified reason for God's punishment is that those children, grandchildren, and great grandchildren hate God and follow their fathers into idolatry. In contrast, the same passage explains that those who follow God and His commandments will be loved by Him, despite the sins of their fathers. Contrary to the claims of skeptics, God does not punish the innocent, including the children of sinners.