This parable was aimed at the "righteous" hypocrisy of the Pharisee's that looked down on those they considered sinners.
Luke 18:9-14 Then Jesus told this story to some who had great confidence in their own righteousness and scorned everyone else: “Two men went to the Temple to pray. One was a Pharisee, and the other was a despised tax collector. The Pharisee stood by himself and prayed this prayer: ‘I thank you, God, that I am not like other people—cheaters, sinners, adulterers. I’m certainly not like that tax collector! I fast twice a week, and I give you a tenth of my income.’
I tell you, this sinner, not the Pharisee, returned home justified before God. For those who exalt themselves will be humbled, and those who humble themselves will be exalted.”