There is a significant difference between the chastening of God and the wrath of God. God wants to take out of us things that are not wholesome, that are not toward His character, so we can become like Him in character and can be saved eternally.
To prepare people for eternal life.