Jesus wants to remind us that performing a series of religious acts doesn't make us right with God. Our attitude matters. What the Bible calls "the heart." While men look at the outside, God looks at the heart.
When the promised Messiah arrived, the Pharisees rejected him and plotted to have him killed, despite having spent their entire lives reading about his coming. Why? He wasn't what they expected him to be.