In his book, The Future of Justification, John Piper addresses the issue of legalism and the first century Jew. Piper responds to some of the notions of the New Perspectives people who claim that first century Jews had not drifted from the grace message of the Old Testament into legalism. He explains . . .
“In regard to the second objection to the general view that “the Jew keeps the law out of gratitude, as the proper response to grace,” it is important to see that, from Jesus’ standpoint, relational exclusivism (ethnic or otherwise) is rooted in self-righteousness, which means that ethnocentrism and legalism have the same root. This connection between self-righteousness and exclusivism is one of the points of Jesus’ parable that begins, “He also told this parable to some who trusted in themselves that they were righteous [dikaioi], and treated others with contempt” (Luke 18:9). A deep root of “treating others with contempt” (whether the others are ethnically similar publicans or ethnically different Gentiles) is: “[They] trusted in themselves that they were righteous. . . . In other words, the exclusivistic treatment of others is one manifestation of the self-righteousness that trusts in its own law-keeping. Legalism and ethnocentrism have the same root. They are not separate conditions of the soul. Jesus’ parable of the Pharisee and the tax collector also shows that the branches of this root of exclusivistic self-righteousness can, amazingly, make protests and prayers to the effect that all is of grace. Thus, the Pharisee prays, “God, I thank you that I am not like other men, extortioners, unjust, adulterers, or even like this tax collector” (Luke 18:11).
Is this not a clear warning to us that finding grace dependent statements in Second-Temple Judaism does not demonstrate that the hearts of those who made those statements were not at root self-righteous (pp. 156-157).
It is interesting to note this idea that legalism and racism are closely entwined. At their core they are both rooted in pride and a superior view of ourselves and our cultural groups.