In Mark 7, the Pharisees complain because Jesus’ disciples don’t follow the rituals the religious leaders had put into place. These rituals were probably thought up in order to make sure that they didn’t break any of God’s laws. What was done out of reverence for God at one point is now being done out of ritual to show one’s holiness in front of others (pride).
Jesus sees through them. He knows that their hearts aren’t right, and He calls them out on it. Rod Cooper mentions in his commentary that
“Jesus was disgusted with the traditions of the scribes and Pharisees. By observing the traditions of men, they neglected the greater law of love. Jesus showed the peril of being content with outward observances while the heart is full of selfishness and sin.”Rodney Cooper, Holman New Testament Commentary: Mark, p. 117
It is important for us to follow the rules, and to obey what He has commanded us, but we need to understand that it is the state of the heart that is important.