God's children must live a disciplined life, that He assures by His correcting, chastening and punishing. We sart to align our character to match that of one hating sin and what it is to be in His image and likeness. If it wasn't done we would be bastard's, but as Our Father He scourges every son He receives.