Because it refused to turn away from its sins and rebellions, God destroyed the Kingdom of Judah and sent the people to exile in Babylon. According to an overriding biblical principle, God is never finished with a situation after he has executed judgment on sin. The next step is always grace and restoration.
Through the prophet Ezekiel, he promised not only to gather up the exiles and return them to Jerusalem. He also promised to give them a new heart and a new spirit.
They would remove all of the abominations and detestable things from the land; no more would Jerusalem and the surrounding countryside see the idol worship that had led to judgment in the first place.
Those who chose to remain in sin could do so, but they would also remain under judgment. God offers grace freely to everyone, but people must accept it in order to benefit from it.
God judged sin once for all on the cross. The resurrection of Jesus Christ demonstrated its final defeat. Grace and restoration came at Pentecost. Jews from all over the world had gathered at Jerusalem for the feast, just in time to witness the power of the Holy Spirit manifested in a new way.
One hundred twenty people, filled with the Holy Spirit, glorified God in languages they had not learned, and Jews from all over the world heard the praise in their native tongues. Peter got up and preached a sermon, and the Christian church was born.
By that time, idolatry was nowhere to be found in or around Jerusalem, but other abominations had arisen that required cleansing, including legalism, judgmentalism, political intrigue, and dullness of heart toward the things of God.
These stubborn sins have worked themselves into the church. The power of the Holy Spirit and the revelation knowledge of the New Testament have been given to cleanse these sins. But again, people must accept grace to benefit from it. Those who refuse remain under judgment.