The sins of the fathers being visited upon the children is a biblical principle. We see, for example, that Isaac seems to learn deception from his father, Abraham. Isaac passes off his wife as his sister, just as Abraham did with Sarah (see Genesis 12:10ff.; 20:1ff.; 26:7). On the other hand, when one looks at the kings of Judah, one can see that some godly kings had wicked sons, just as some wicked kings had godly sons. There is a tendency and a trend, but not an irreversible certainty.
The most encouraging text, however, is found in Jeremiah chapter 31, which speaks of the “new covenant.” Look especially at Jeremiah 31:29-34. In this text God assures His people that under the New Covenant the sins of the fathers will no longer be visited upon their children. Praise God!
[ Walvoord, John F., and Zuck, Roy B., The Bible Knowledge Commentary, (Wheaton, Illinois: Scripture Press Publications, Inc.) 1983, 1985.]