God placed Judah in refining fire for His name sake.
For my name’s sake will I defer mine anger, and for my praise will I refrain for thee, that I cut thee not off. Behold, I have refined thee, but not with silver; I have chosen thee in the furnace of affliction. For mine own sake, even for mine own sake, will I do it: for how should my name be polluted? and I will not give my glory unto another. (Isaiah 48:9-11 KJV)
It was only because of the godly purpose God had for Judah that it was not annihilated or destroyed for its evil and darkness. God had a divine purpose and will to bring Him great honor and glory for this land of Judah. Rather than destroy Judah God sent them into the fiery furnace of affliction amidst great trials to refine and polish them.
God could not allow His perfect name to be in any way associated with evil pollution of this world. He cannot be entwined in any way or form with sin. God sent Judah into the heat and flame to remove dross or sin, and make Judah into something that could bear the name of God without reproach. God was making Judah into a godly land which brought Him glory and honor.
The name of God was at stake in Judah and godliness was the only acceptable condition He could permit His holy name be associated with. Therefore, removing sinful garbage from the land of Judah was a must!