They were trying to impress God with their righteousness by paying more attention to the smallest details of the physical aspects of the law than to its spiritual purpose.
Paul pinpointed their problem: "Brethren, my heart's desire and prayer to God for Israel is that they may be saved. For I bear them witness that they have a zeal for God, but not according to knowledge. For they being ignorant of God's righteousness, and seeking to establish their own righteousness, have not submitted to the righteousness of God" (Romans 10:1-3 Romans 10:1-3  Brothers, my heart's desire and prayer to God for Israel is, that they might be saved.
 For I bear them record that they have a zeal of God, but not according to knowledge.
 For they being ignorant of God's righteousness, and going about to establish their own righteousness, have not submitted themselves to the righteousness of God.
American King James Version×).
Jesus emphasized the law's original purpose and spiritual intent (Matthew 5:17-48 Matthew 5:17-48  Think not that I am come to destroy the law, or the prophets: I am not come to destroy, but to fulfill.
 For truly I say to you, Till heaven and earth pass, one stroke or one pronunciation mark shall in no wise pass from the law, till all be fulfilled.
 Whoever therefore shall break one of these least commandments, and shall teach men so, he shall be called the least in the kingdom of heaven: but whoever shall do and teach them, the same shall be called great in the kingdom of heaven.
 For I say to you, That except your righteousness shall exceed the righteousness of the scribes and Pharisees, you shall in no case enter into the kingdom of heaven.
 You have heard that it was said of them of old time, You shall not kill; and whoever shall kill shall be in danger of the judgment:
 But I say to you, That whoever is angry with his brother without a cause shall be in danger of the judgment: and whoever shall say to his brother, Raca, shall be in danger of the council: but whoever shall say, You fool, shall be in danger of hell fire.
 Therefore if you bring your gift to the altar, and there remember that your brother has ought against you;
 Leave there your gift before the altar, and go your way; first be reconciled to your brother, and then come and offer your gift.
 Agree with your adversary quickly, whiles you are in the way with him; lest at any time the adversary deliver you to the judge, and the judge deliver you to the officer, and you be cast into prison.
 Truly I say to you, You shall by no means come out there, till you have paid the uttermost farthing.
 You have heard that it was said by them of old time, You shall not commit adultery:
 But I say to you, That whoever looks on a woman to lust after her has committed adultery with her already in his heart.
 And if your right eye offend you, pluck it out, and cast it from you: for it is profitable for you that one of your members should perish, and not that your whole body should be cast into hell.
 And if your right hand offend you, cut it off, and cast it from you: for it is profitable for you that one of your members should perish, and not that your whole body should be cast into hell.
 It has been said, Whoever shall put away his wife, let him give her a writing of divorce:
 But I say to you, That whoever shall put away his wife, saving for the cause of fornication, causes her to commit adultery: and whoever shall marry her that is divorced commits adultery.
 Again, you have heard that it has been said by them of old time, You shall not forswear yourself, but shall perform to the Lord your oaths:
 But I say to you, Swear not at all; neither by heaven; for it is God's throne:
 Nor by the earth; for it is his footstool: neither by Jerusalem; for it is the city of the great King.
 Neither shall you swear by your head, because you can not make one hair white or black.
 But let your communication be, Yes, yes; No, no: for whatever is more than these comes of evil.
 You have heard that it has been said, An eye for an eye, and a tooth for a tooth:
 But I say to you, That you resist not evil: but whoever shall smite you on your right cheek, turn to him the other also.
 And if any man will sue you at the law, and take away your coat, let him have your cloak also.
 And whoever shall compel you to go a mile, go with him two.
 Give to him that asks you, and from him that would borrow of you turn not you away.
 You have heard that it has been said, You shall love your neighbor, and hate your enemy.
 But I say to you, Love your enemies, bless them that curse you, do good to them that hate you, and pray for them which spitefully use you, and persecute you;
 That you may be the children of your Father which is in heaven: for he makes his sun to rise on the evil and on the good, and sends rain on the just and on the unjust.
 For if you love them which love you, what reward have you? do not even the publicans the same?
 And if you salute your brothers only, what do you more than others? do not even the publicans so?
 Be you therefore perfect, even as your Father which is in heaven is perfect.
American King James Version×). This irritated many Jewish religious leaders. They had fallen into the habit of measuring righteousness according to outward appearance. They emphasized physical details and ceremonial cleanliness to the neglect of the "weightier matters" of God's law, such as justice, mercy and faith (Matthew 23:23-25 Matthew 23:23-25  Woe to you, scribes and Pharisees, hypocrites! for you pay tithe of mint and anise and cummin, and have omitted the weightier matters of the law, judgment, mercy, and faith: these ought you to have done, and not to leave the other undone.  You blind guides, which strain at a gnat, and swallow a camel.  Woe to you, scribes and Pharisees, hypocrites! for you make clean the outside of the cup and of the platter, but within they are full of extortion and excess.
American King James Version×).
Jesus sternly criticized this misplaced emphasis: "Woe to you, scribes and Pharisees, hypocrites! For you are like whitewashed tombs, which on the outside look beautiful, but inside they are full of the bones of the dead and of all kinds of filth. So you also on the outside look righteous to others, but inside you are full of hypocrisy and lawlessness" (Matthew 23:27-28 Matthew 23:27-28  Woe to you, scribes and Pharisees, hypocrites! for you are like to white washed sepulchers, which indeed appear beautiful outward, but are within full of dead men's bones, and of all uncleanness.
 Even so you also outwardly appear righteous to men, but within you are full of hypocrisy and iniquity.
American King James Version×, NRSV).
Their distorted emphasis stripped away the real intent and purpose for God's law. In contrast, Christ upheld the real intent of the law. And Paul simply continued Christ's correct emphasis—including the fact that the law's ceremonies and rituals served only as temporary reminders of better things to come.
Both Jesus and Paul always upheld the law's teachings that affect our heart, mind and behavior. These aspects of the law remain eternally applicable. They reveal not only what is sinful but also the true righteousness God desires to write in our hearts and minds. Christians are directed to rightly understand and willingly apply the true focus of the law to their own lives.