What comes out of the mouth proceeds from the heart, and this defiles a person. For out of the heart come evil thoughts, murder, adultery, sexual immorality, theft, false witness, slander. These are what defile a person. But to eat with unwashed hands does not defile anyone. Matt. 15:18-20, ESV.
The second half of the conflict over uncleanliness finds Jesus turning His back on the Pharisees and speaking first to the crowd, who have apparently been standing out of the line of fire, and then to the disciples.
He tells the crowd that the Pharisees don't really understand true defilement, and by extension, true religion (Matt. 15:10, 11). Then the disciples come to Jesus, pointing out that He had offended the Pharisees in His teaching on the subject. To which Jesus replied that they were merely blind leaders leading other blind leaders, and that following them would only result in disaster (verses 12-14).
But Peter, and probably the other disciples, isn't satisfied, so he presses Jesus for more explanation. Apparently the teaching on ceremonial uncleanness was so pervasive in Judaism that even the disciples were having a difficult time understanding Jesus' perspective.
That explains His exasperated words to them in verses 16 and 17. In essence He says, "How can you be so dull? After all the time you have listened to Me, can't you see what I mean?"
Jesus continues to explain to His slow-witted disciples that genuine defilement is not a matter of externals--what goes into a person. Rather, it is rooted in the heart (a person's inner being), and it is out of a sinful heart that sinful acts proceed (verses 17-20).
In short, true religion is not a matter of externals. Rather, it finds its source in an attitude of love toward God and other people. That mind-set becomes the source for all a person's actions. Later Jesus will become even more specific on this point, noting that all of God's commandments are built upon agape (love) to God and other people (Matt. 22:36-40).
In Matthew 15 we have the very core of Jesus' definition of true religion. What a pity it is that so many of us remain focused on the items of do and don't while missing the real thing. While some of those do's and don't's may be important, they are so only when the heart is right.