"'Go up and down the streets of Jerusalem, look around and consider, search through her squares. If you can find but one person who deals honestly and seeks the truth, I will forgive this city. Although they say, "As surely as the Lord lives," still they are swearing falsely.'" NIV translation
A challenge is issued to find one righteous man in the whole city of Jerusalem. God offers to spare the entire city for one man but there is not even one. We remember, from Genesis 18, how Abraham had asked God to spare Sodom and Gomorrah if ten righteous men could be found. Either Abraham did not understand the depth of their sin or the heights of God's mercy when he stopped asking at ten.
We see that, in Jerusalem, there were those who were claiming to acknowledge God but it was not a reality in their lives. Jesus also said that there would be those that, on the last day, do not enter heaven even though they had done things in His name. We see from both cases that what matters is what is in the heart.
"Lord, do not your eyes look for truth? You struck them, but they felt no pain; you crushed them, but they refused correction." NIV translation
We see that God is right in punishing them because He gave them the opportunity to turn from their ways but they refused.
As we see in Hebrews 12, correction from God is a sign that we are His children.
"I thought, 'These are only the poor; they are foolish, for they do not know the way of the Lord, the requirements of their God. So I will go to the leaders and speak to them; surely they know the way of the Lord, the requirements of their God.' But with one accord they too had broken off the yoke and torn off the bonds." NIV translation
We see that God is right in His judgment as they could not use the "I didn't know" excuse. It was not just the uneducated people that were disobedient but also the city leaders. They are compared to oxen that had been hooked up to a load but had gone wild and broken away from the cart.