In Verse 9, we are told that the parable is a response to “those that were confident in their own righteousness and looked down on everyone else.” The prefect participle πεποιθότας (pepoithotas) indicates they have been (already) convinced they are right with God. But they are not simply self-confident: they “despise” others. The verb ἐξουθενέω (exoutheneo) has the connotation of disdain, “to show by one’s attitude or manner of treatment that an entity has no merit or worth” (BAGD). Imagine a very wealthy person who treats the “help” poorly. The poor servants are not worthy of consideration at all, they care mistreated or simply ignored as people. This is the attitude of those Jesus targets with this parable.
Jesus’ ministry is focused on these despised people, the outsiders and outcasts who are beneath consideration in polite society of religion of the first century. It is obvious that other Jewish teachers would love to see these outsiders return to covenant faithfulness and “get right with God.” The difference between Jesus and most religious groups in first-century Judea was that Jesus sat down and ate with sinners, showed them some respect, and forgave their sins. If the stories of rabbi Shammai reflect his character, he might have taken a stick to a person who came to him and asked “what must I do to be saved?” If someone did want to repent and they asked an Essene what was required, they would be given a fairly hefty Manual of Discipline and put on probation for three years!
We are not told who the self-righteous in Luke 18 are, but the first group that comes to mind are the Pharisees. Jesus is questioned by a Pharisee in Luke 17:20, but the persons being taught in chapter 18 are the disciples. Jesus does not answer the Pharisee, but teaches his disciples in 17:22. In 18:1 the disciples are still the focus of the teaching. There may be no connection at all between the Pharisee of 17:20 and this parable.
If this is true, then it is likely that there were a few disciples who were self-righteous, perhaps a bit arrogant because they knew since they were following Jesus, they were “right” and the Pharisees were wrong. The parable is not aimed at “those arrogant Pharisees over there,” but at Jesus’ closest followers, the inner circle of disciples who were appointed by Jesus himself. Instead of the imaginary legalistic Pharisee, Jesus is pointing his finger and Peter, James and John. He is telling them that they are not right with God just because they joined the right teacher or (finally) understood that Jesus is the Messiah. They too have to ask for mercy and experience the grace of God.
You are not right with God because you gave up your sins, as if that is even possible. You are not right with God because you endured a particular religious ritual. You are not right with God because you kept the ten commandments for most of your life. You are not right with God because you are a good person.
You are not “right with God” because you signed the right doctrinal statement or can quote the proper creed, or because you attend the right church, or because you have the best worship music, or because your book sold 20 million copies.
You are not right with God because you don’t drink coffee at Starbucks, or because you do eat a particular chicken sandwich, or because you shoot guns, or you do not own guns, or you voted for the right candidate.
You are right with God because you asked for mercy and experienced his grace.