Why would sins affect children and grandchildren? This is no arbitrary punishment. Children still suffer for the sins of their parents. Consider child abuse or alcoholism, for example.
While these sins are obvious, sins like selfishness and greed can be passed along as well. Be careful not to treat sin casually, but repent and turn from it. The sin may cause you little pain now, but it could later sting in a most tender area of your life-your children and grandchildren.
I lavish unfailing love to a thousand generations.I forgive iniquity, rebellion, and sin.But I do not excuse the guilty.I lay the sins of the parents upon their children and grandchildren;the entire family is affected—even children in the third and fourth generations.” – Exodus 34:7