He was warning them that they had strayed from God's teachings even though they kept shouting out their faithfulness to God. However, Jesus speaks through time to us as well. This is a warning also for those who tout their allegiance to God, but then turn their backs on His children.
We have politicians who hold the Bible while practicing policies that are entirely un-Christian. They claim they are making decisions based on the Bible, but spread hate, greed, and uncharitable actions. Jesus warns the chief priest and elders that there "tax collectors and prostitutes are entering the kingdom of God ahead of you." In today's world, He would likely tell members of the "religious right" that "transgendered people and women who have had abortions are entering the kingdom ahead of you."
The harsh truth is that many "christian" political groups have used their version of "christianity" to judge others, to maintain economic and political dominance, and to divert attention from their own faults. They are the ones who truly take God's name in vain, for they use His name with abandon yet abandon His actual teachings. Meanwhile, the abused, lost, and forsaken in our society are the ones who hold to His Word.
I think on those people I have known in life who have turned away from the Church, often because of the abuse of the Church. However, they live their lives with a moral code, treating others with decency and compassion. They follow Christ's teachings if not knowing that they follow Him. They are the first son, who say "no" but do good His works anyway.
Meanwhile, I know many who claim to be Christian, who post pictures of Jesus and regularly type "Amen," but who lack love and compassion in their hearts. They are quick to condemn the life choices of others, but then support terrible policies and even atrocities because "that's the way the world works." They have said "Yes" to God in word only.
Personally, I hope to be one who says both "Yes" and who does God's work. However, even in this post, I have thought and written with condemnation in my heart. As said in the second reading, I need to work at "looking out not for [my] own interests, but also for those of others."