“My son, do not despise the LORD’s discipline, and do not resent his rebuke, because the LORD disciplines those he loves, as a father the son he delights in.” Proverbs 3:11-12 NIV
I prefer to not think of God as a punishing God, but these Proverb verses put God's discipline into the perspective of a father disciplining his child. Food for thought.