When the Savior comes again, the righteous will be rewarded and the wicked punished. Isaiah has prophesied elsewhere, 'But with righteousness shall he judge the poor, and reprove with equity for the meek of the earth; and he shall smite the earth with the rod of his mouth, and with the breath of his lips shall he slay the wicked' (Isa 11:4). The judgment upon the wicked will take more than one form and will be accomplished through wars, destructions, earthquakes, famines, etc. The scriptures refer to this as the destruction of Babylon, the end of the world, or the destruction of the wicked. However, this verse seems to also apply to events after the wicked have already been destroyed, but why would people need to be rebuked after the Second Coming?
A common misconception is that everything will be perfect as soon as the Lord comes. The truth is that outside of Zion and Jerusalem, there will still be many who don't believe. Not everyone will immediately join the church. Others will commit sin, even without the temptations of Satan. The glory and order of Zion will not prevail over the entire earth. The heathen nations will need direction, and that direction will come from Zion and Jerusalem. '…then cometh the day when the arm of the Lord shall be revealed in power in convincing the nations, the heathen nations, the house of Joseph, of the gospel of their salvation.
For it shall come to pass in that day, that every man shall hear the fulness of the gospel in his own tongue, and in his own language, through those who are ordained unto this power' (DC 90:10-11). Those who reject the Lord and his messengers during the Millenium will be judged and rebuked according to the word of Isaiah.
"There will be wicked men on the earth during the thousand years. The heathen nations who will not come up to worship will be visited with the judgments of God, and must eventually be destroyed from the earth." (Teachings of the Prophet Joseph Smith, selected and arranged by Joseph Fielding Smith [Salt Lake City: Deseret Book Co., 1976], 268.)