Mark 2:14-17
14 And as he passed by, he saw Levi the son of Alphaeus sitting at the receipt of custom, and said unto him, Follow me. And he arose and followed him.
15 And it came to pass, that, as Jesus sat at meat in his house, many publicans and sinners sat also together with Jesus and his disciples: for there were many, and they followed him.
16 And when the scribes and Pharisees saw him eat with publicans and sinners, they said unto his disciples, How is it that he eateth and drinketh with publicans and sinners?
17 When Jesus heard it, he saith unto them, They that are whole have no need of the physician, but they that are sick: I came not to call the righteous, but sinners to repentance.
The Grace New Testament Commentary - Mark 2:16-17
2:16-17 The scribes and the Pharisees are greatly troubled. Their question to His disciples was, "How is it that He eats with tax collectors and sinners?" They could not reconcile how a holy man could fellowship with sinners. Of course, the Lord was ever protective of His disciples and quickly came to answer their question. "Those who are well have no need of a physician, but those who are sick. I did not come to call the righteous, but sinners to repentance."
A common way of understanding Jesus' illustration is that the righteous represents those who wrongly think they are righteous. Thus Jesus' point is that He came not to call to repentance the self-righteous legalists, but instead those who recognize their sinfulness. However, that is precisely what Jesus did not say. He said nothing about those who wrongly think they are righteous. He spoke of the righteous.
Jesus did not come to call to repentance those who were righteous in their experience. Such people do not need to repent since they are already in fellowship with God. Instead He came to call to repentance those who are not righteous, but who are sinners. The Greek word used for sinners (hamartōloi), was often used in conjunction with tax collectors, and in such places it referred to those who were notoriously wayward, that is, unrighteous in their experience (cf. Matt 9:10-13; 11:19; Luke 5:30-32; 7:34-39; 15:1-2, 7, 10). Clearly Jesus' call applies to both wayward believers and unbelievers.
Thomas Constable's Expository Notes on the Bible - Mark 2:17
2:17 Self-righteous people, such as these Pharisees, saw no need for true righteousness, because they viewed themselves as already righteous. However the people whom the Pharisees labeled "sinners" represented real sinners: those lacking righteousness. Jesus said that He spent time with sinners because they were the people who felt a need for what He had to offer, namely, spiritual healing. He was evidently modifying a well-known proverb. Jesus was using the terms "righteous" and "sinners" ironically here.