There are two things to consider, when we read these passages. The first thing is that God looks at the heart of man. The second is, that man sees only the outside ceremonies, and traditional religious duties, but does not see the heart of other people.
Now, we can clearly see here, that there are many traditional religious things, which a man can invent and practice. There are plenty of philosophies and religions in the world today, but the people practicing them, do not have the Holy Spirit, because, they do not believe in Jesus, and are not born again. And Jesus said that we need to be born again. Only the born again Christians, have a new heart, new creation given from God.
God does not care about our man-made religious rules, regulations and ceremonies. He cares about the state of our heart (spirit), if it is changed and born again from God or not! Because only a born again Christian, can do the commandments of God, because the Holy Spirit will give him power and grace to do that!
If a person is not born again from the Holy Spirit, he would not have the power and the grace to do the commandments of God, and to live the Christian life! Because the Christian life is supernatural.
That is why, Jesus did not care about their traditions and ceremonies, because their heart was not transformed and changed by them.
People can go to hell by taking with them, their religion. Religion is only for the body, and the mind, but does not change the heart. Only God makes the heart a new creation.
That is why in these verses, we can see that Jesus was looking at the heart of people, and not the external form of religion.
God the Father, is looking for people who will worship him by their born again spirits, which is with the heart. Only the born again spirit-heart of man, has eternal life from God, because it has become one with the Holy Spirit.