In chapter 7 Ezra enters the story. He is a priest descended from Aaron, the first priest, and a godly man:
10 For Ezra had devoted himself to the study and observance of the Law of the Lord, and to teaching its decrees and laws in Israel.
This is the kind of mentality every person of God should have, devotion to study, observe and teach God’s word.
Ezra comes from Babylon with a letter and charge from Artaxerxes to lead the people to follow the Lord their God, and they worship in the way proscribed. The last two chapters are about some of the men intermarrying with the women of the land, and thus sinning greatly against God. When Ezra finds out about this, he tears his clothes and hair and beard, and repents before God, and because of his leadership all the people with him.
They finally come up with a plan where all the men who intermarried will be identified and their women and children sent off. It takes them three months of investigation, but in chapter 10 they name all of the men who married foreign women, 110 by my count. This out of 40,000 plus exiles who returned from Babylon. A small number to be sure, but before the Lord God of Israel, the standard for blessing is perfection. And as long as the Law is the focus of blessing, it will always be so. Christ offers another way. The law and our failure drive us to him, and forgiven and accepted by the just judgment of God on Christ, we now want to follow God’s law.