Matthew was a tax collector for the Roman government, a profession whose members were reviled by the people of Judea as collaborators with the occupying enemy. Jesus found him sitting receiving payments and asked Matthew to follow him, and Matthew did so. Soon, as Jesus sat eating, many tax collectors and other sinful people were sitting down with him and his disciples.
“Why does your master eat with traitors and sinners?” the devout Jews asked his disciples.
“Those who are whole do not need a physician, but those who are sick do,” said Jesus, having overheard. “Learn the meaning of the saying ‘I desire mercy, and not sacrifices‘. I have not come to call the righteous, but sinners to repentance.”
Jesus is saying that he wants to help those who are farthest from it to enter the Kingdom of Heaven. The saying he quotes to the devout Jews (the Pharisees) is from the book of Hosea, in which God tells his people that showing mercy is more important than offering sacrifices.