Look at the context of Matt. 5:18.
“Do not think that I have come to abolish the Law or the Prophets; I have not come to abolish them but to fulfill them. For truly, I say to you, until heaven and earth pass away, not an iota, not a dot, will pass from the Law until all is accomplished … For I tell you, unless your righteousness exceeds that of the scribes and Pharisees, you will never enter the kingdom of heaven. (Matt 5:17–18,20, ESV}
- In v17 Jesus doesn’t say that he came for you to fulfill the Law, but for him to fulfill it.
Note Jesus’ statement:
When Jesus had received the sour wine, he said, “It is finished,” and he bowed his head and gave up his spirit. (John 19:30, ESV)
See greek - Tetelestai - What did Jesus really say in John 19:30 assuming he spoke Aramaic or Hebrew?
When Paul wrote:
For Christ is the end [τέλος] of the law for righteousness to everyone who believes. (Rom. 10:4, ESV)
He did not mean Christ abolished the Law, but that Chrit fulfilled the requirements of the Law for us.
Paul wrote this clearly in Romans 8:3-4:
For God has done what the law, weakened by the flesh, could not do. By sending his own Son in the likeness of sinful flesh and for sin, he condemned sin in the flesh, 4 in order that the righteous requirement of the law might be fulfilled in us, who walk not according to the flesh but according to the Spirit.
(ESV)
- In v20 the scribes and Pharisees were the humanly best at keeping the Law. Thus, it is humanly impossible to enter the kingdom of heaven by keeping the Law.
When Jesus went on to discuss anger and lust, he pointed out that keeping the law is more than external action, but included internal thought.
Note the greatest commandment of the Law:
And behold, a lawyer stood up to put him to the test, saying, “Teacher, what shall I do to inherit eternal life?” He said to him, “What is written in the Law? How do you read it?” And he answered, “You shall love the Lord your God with all your heart and with all your soul and with all your strength and with all your mind, and your neighbor as yourself. (Luke 10:25–27, ESV).
This lead to the parable of the Good Samaritan. Those keeping the ceremonial aspects of the Law failed to keep the more important part of the Law.
Jesus, referencing Hosea 6;6, said,
Go and learn what this means: ‘I desire mercy, and not sacrifice.’ For I came not to call the righteous, but sinners. (Matt. 9:13, ESV)
Paul wrote:
Owe no one anything, except to love each other, for the one who loves another has fulfilled the law. For the commandments, “You shall not commit adultery, You shall not murder, You shall not steal, You shall not covet,” and any other commandment, are summed up in this word: “You shall love your neighbor as yourself.” Love does no wrong to a neighbor; therefore love is the fulfilling of the law. (Rom. 13:8–10, ESV)
Conclusion
When it comes to the purpose of dietary requirements of the Law, look at Peter’s vision in Acts 10:18-33. Peter gives his interpretation of the vision as:
You yourselves know how unlawful it is for a Jew to associate with or to visit anyone of another nation, but God has shown me that I should not call any person common or unclean. (Acts 10:28, ESV)
However, Peter’s previous statement:
But Peter said, “By no means, Lord; for I have never eaten anything that is common or unclean.” (Acts 10:14. ESV)
Showed that until than point Jesus and his disciples had kept the dietary laws. However, the problem with the dietary laws is they separated Jew from Gentile.
Note Paul’s statement:
But when Cephas came to Antioch, I opposed him to his face, because he stood condemned. For before certain men came from James, he was eating with the Gentiles; but when they came he drew back and separated himself, fearing the circumcision party. And the rest of the Jews acted hypocritically along with him, so that even Barnabas was led astray by their hypocrisy. But when I saw that their conduct was not in step with the truth of the gospel, I said to Cephas before them all, “If you, though a Jew, live like a Gentile and not like a Jew, how can you force the Gentiles to live like Jews?” (Gal. 2:11–14. ESV)
Thus, Jesus' statement in Matthew 15:11 had both the purpose and internal aspects of the Law in mind as well as setting the stage for the salvation of the Gentiles.