“Keeping steadfast love for thousands, forgiving … sin, but who will by no means clear the guilty, visiting the iniquity of the fathers on the children and the children’s children…”
Exodus 34:7 ESV
God can only be good and loving. He would cease being God if He were not good and loving because they are part of His very being. So, any time you think something is making God out to be unloving or evil means there is something wrong with your understanding. Nothing is ever wrong with God. He does all things perfectly.
We read that verse today, but we also have Ezekiel 18:20 that says each dies for his own sins, and not for the sins of his father.
Parents pass on a legacy. We first read this phrase about generations suffering in the ten commandments. It goes along with thou shalt not worship idols. Parents pass on to their kids what they worship.
It’s actually an expression of God’s mercy that He comes in and breaks cycles and helps those trapped in idolatry to seek and find Him.