Nehemia (and Ezra?) can be said as a proto-Pharisee. It means that he cared deeply about holiness as the evidence of true Israelites. After the Israelites returned from the exile, there were concerns that they would repeat what their ancestors did earlier which prompted YHWH to send them to exile to Babylon. In order to avoid that to happen again, a movement which revolved around the Torah grew. Its goal was simple, i.e., to prevent the wrath of YHWH through intensification of Torah which would be reflected through daily holiness.
Of course, not everyone would adhere to this strict code of holiness. Some would just live according to their own ways and not care a bit of what Nehemia said to them. And that’s why the question of who were the true Israelites came to the surface, whether it was the party of Nehemia or the other ones. And that’s why Nehemia prayed to God that he would remember Nehemia for all that he had done for God (Neh 13.14, 22, 31). It sprang from a belief that God will judge his people at the end of the age and Nehemia hope that he would be found as the true people of God and not the false one.
And I think this is the more appropriate way to understand Pharisaism. It began by a sincere motive to honor God’s Word and live in holiness according to it. But then sincerity is not and never enough. The suicide bombers perhaps were sincere in their obedience towards Allah, but no one in their right mind would approve of what they did. Saul of Tarsus was sincere, his conscience is clear, yet he used his great zeal to persecute a young sect before he himself converted to that sect. And perhaps the Pharisee who prayed in Luke 18 was sincere, but then now we use his prayer as an example of what kind of prayer that we should not ever pray.