The people find out that the Law of Moses says that they shouldn't let any Ammonites or Moabites into their society, since these tribes refused to give their Israelite ancestors food and hired Balaam to curse them. (See Numbers 22:5.)
So the people refuse to hang around these particular foreigners.
The priest Eliashib prepares a room for Israel's old enemy Tobiah in the chamber where they used to store the grain offering, frankincense, vessels, tithes, wine, and oil.
Nehemiah isn't there while this is happening because he's paying a visit to King Artaxerxes back in Persia.
When he returns and finds out what went down, he throws out all of Tobiah's furniture and brings back the grain, vessels, and other things they used to keep in that room.
He discovers that the Levites and singers weren't receiving their fair portion, so he fixes this and appoints a new group of treasurers to make sure the Levites get their share.
Nehemiah asks God to remember him for all these righteous deeds.
Nehemiah sees that the people are pressing grapes and selling and buying food on the Sabbath.
He tells them to knock it off, explaining that this is exactly the kind of behavior that got them exiled in the first place.
He orders the gates to the city shut when the Sabbath begins, and says that they shouldn't be opened until it ends.
The merchants and sellers end up spending the night outside the city for one or two Sabbaths before Nehemiah threatens to arrest them.
Nehemiah also commands the Levites to purify themselves and guard the gates to make sure the Sabbath is kept holy.
He again asks God to remember these good deeds and count them in his favor.
Nehemiah also takes on Jews who've married women from Ashdod, Ammon, and Moab, and whose half-foreign children can't speak Hebrew.
He curses and beats some of the men who've married such women, and pulls out their hair, forcing them to swear to give up their foreign wives and kids.
This is a very convincing tactic.
He uses the example of King Solomon marrying foreign women as an example of how destructive it can be.
Jehoiada's son is friends with that villainous Sanballat. Nehemiah chases Jehoiada's son away from him, and tells God to remember how this guy defiled the priesthood.
Nehemiah states that he eliminated all foreign practices, established the duties of priests and Levites, and took care of the wood offering and first fruits.
As the book ends, he asks God again to remember him for these good deeds.