Nehemiah's actual work was the reconstruction of a conceptual wall between the Jewish people and their neighbors in the same vein as the work of Jeshua and Zerubbabel and Ezra before him (the last of whom also worked with him). Nehemiah's main challenge was the porous boundary between returned Israel and its neighbors. The failure or absence of this boundary revealed itself in situations in which the people of God and their neighbors were so intermingled as to be indistinct from one another. The lack of a boundary was caused by Israel's failure to grasp and maintain its uniqueness, which in turn facilitated the invasive behavior of prominent Gentiles. Nehemiah's objective was to reestablish Israel's national selfhood. Doing so required Israel to know and be committed to who it was, which in turn required them to know and commit to who they were not.
Nehemiah's first step in his campaign was to build Jerusalem's still-ruined wall. It is instructive to note why Nehemiah felt that the ruin of the wall was such a bad thing. The report he received about the returned Jews was that "[t]he remnant that remains from the exile there in the province are experiencing considerable adversity and reproach. The wall of Jerusalem lies breached, and its gates have been burned down!" (1:3). When asked by the Persian king what is wrong, Nehemiah replies, "Why would I not appear dejected when the city with the graves of my ancestors lies desolate and its gates destroyed by fire?" (2:3). And after he surveys the condition of the wall, he urges the exiles, "You see the problem that we have: Jerusalem is desolate and its gates are burned. Come on! Let's rebuild the wall of Jerusalem so that this reproach will not continue" (2:17).
The problem of the broken wall wasn't physical safety, because hardly anyone was living there anyway and because Nehemiah had no intention of setting up an independent Jewish state with defenses against the Persian military (contra his enemies' slander in 6:6-9). The problem of the broken wall was reproach, shame, and embarrassment before the nations, exemplified by the desecration of the graves of the Jews' ancestors. It is worth remembering that shame first appears in Scripture with the sin of Adam and Eve. Prior to their fall they were both naked but unashamed. In their perfect state their sense of who self was to be was so powerful that it could not be threatened even when completely exposed. But when sin entered them, they had to erect a physical barrier between themselves and others—clothes—to cover their emptiness and to make an artificial delineation between where oneself stops and the world starts. Jerusalem's wall was that artificial delineation for the Jewish people. Without it they were naked and ashamed and subject to total violation as a people by their neighbors. If allowed to continue, the boundary would become so vaporous that they would cease to be a people altogether. With the Persian army nearby, the wall of Jerusalem was unnecessary for security, but it was essential for the self-concept of the Jewish nation.
Nehemiah instinctively knew this, and that's why he concentrated his early effort on the wall. While the people built the physical wall, they were also building the conceptual wall between themselves and non-Jews. They were relearning who they were and who they weren't. This immediately led to problems with certain prominent Gentiles among the Jews' neighbors who had become accustomed to having considerable sway in the Jews' affairs. Nehemiah was leading the people to push them out of the Jewish sphere and back into their own, and so their resistance grew more and more furious. Once again, note that the Jews' physical safety wasn't threatened until after they had been working on the wall. Prior to the reconstruction physical safety was a nonissue because Sanballat, Tobiah, and Geshem enjoyed their influence in the Jewish community. It was only after they recognized that a line was being drawn and they were on the opposite side of it that violence from them became a real danger.
Nehemiah's intention to reestablish the self of the Jewish people ties together all his activities. He enforces the Law of Moses with respect to forbidding lending at interest to fellow Jews, and 5:8 implies that he led a campaign to buy back Jewish slaves of Gentile masters in order to prevent that forced intermingling. Similarly, Nehemiah connected all Jews living in Judea to the genealogical record that had been composed when the first exiles arrived, and on that basis he enforced the ban on intermarriage as Ezra had. Much of what Nehemiah did was centered in the temple as the heart of what made the Jews, Jews, once again following the pattern Ezra had set. So a major focus for Nehemiah was requiring the traditional contributions to be brought into it for its upkeep and the maintenance of the priesthood. Nehemiah continued to encourage Ezra's agenda to teach people the Law of Moses and how to follow it (especially the Sabbath), and he took part in a major covenant renewal ceremony that rehearsed Israel's history. All these efforts reinforced the boundary between the Jews and the nations and reminded the Jews that they were unique.
Nehemiah has frequently been cited as a premier biblical study on leadership. I agree wholeheartedly, but not because Nehemiah effectively gets things done (though he does). It's because Nehemiah depicts the real-world trials and tribulations of a leader who is trying to elevate the cohesion and maturity of character of his organization in the face of forces within and without that relentlessly try to keep it stuck in the dysfunctional mess that it was when he got there. A major lesson of Nehemiah is that true leadership always produces sabotage that makes the leader feel painfully alone. Not only does this leadership temporarily lead its followers from false peace into openly dangerous conflict, but it also invites roundabout pushback by those who are outwardly compliant but actually undermining reform. The most glaring example in Nehemiah is that, try as he might, he could not get Tobiah the Ammonite permanently out of the community of Israel. The very leaders of the people were joined with him through marriage and tried to broker a truce that would compromise Nehemiah's mission. While Nehemiah was back in the Persian capital serving the king for a spell, his whole renewal project began to degenerate, and Tobiah managed to carve out a nice room for himself in the very temple, courtesy of the high priest of all people! When Nehemiah returned he promptly threw Tobiah's belongings out and cleansed the place and likewise reasserted his other lapsed reforms. Since he couldn't build the wall again with the symbolic significance that that entailed, he did the next best thing, which was to hold a grand and elaborate dedication ceremony for it twelve years after it had been built.
That ceremony included a reading from the Law that Nehemiah summarized like this:
On that day the book of Moses [presumably Deuteronomy] was read aloud in the hearing of the people. They found written in it that no Ammonite or Moabite may ever enter the assembly of God, for they had not met the Israelites with food and water, but instead hired Balaam to curse them. (Our God, however, turned the curse into blessing.) When they heard the law, they removed from Israel all who were of mixed ancestry [13:1-3].The identification of the Ammonites and Moabites as people to be forever excluded from the assembly is significant, because Tobiah was an Ammonite and Sanballat was a Moabite (from Horonaim), and these were Nehemiah's two main adversaries. However, in the very passage that the Jews heard that day (Deut. 23:1-8), God affirms that Edomites and Egyptians are allowed in the assembly of Yahweh. In his zeal for purity, Nehemiah seems to have overlooked that part and led the people to exclude all foreigners from Israel.
It is at this point that Nehemiah seems, ironically, to have overstepped his bounds. It is one thing to exclude who you aren't because you are establishing who you are. It's another thing to establish who you are in reaction to who you don't want to be. That seems to be the case here. Indeed, there is no hint in Nehemiah that the very purpose of Israel's strong identity as the "kingdom of priests and holy nation" of Yahweh is for the redemption of all the nations. A new kingdom and nation would have to be established to become the conduit of that blessing—provided it remains as holy in its own way as Nehemiah wanted the Jews to be.