Parable of the Two Sons: Matthew 21:28-32
Jesus tells this parable of the two sons to illustrate how actions are more important than intentions.
In context, Jesus tells this parable to the religious leaders in order to show them their disobedience to God. The religious leaders ask Jesus, "By what authority are you doing these things, and who gave you this authority?" (Matthew 21:23)
Jesus tells them he will answer their question if they answer his question. He asks, "Did the baptism of John (the Baptist) come from heaven, or was it of human origin?" (Matthew 21:25)
However, the religious leaders know "If we say, 'From heaven,' he will say to us, 'Why then did you not believe him?' But if we say, 'Of human origin,' we are afraid of the crowd; for all regard John as a prophet." (Matthew 21:25-26)
Therefore, they say "We do not know." Jesus then says, "Neither will I tell you by what authority I am doing these things." (Matthew 21:27) He then tells them the parable of the two sons, which he relates back to John the Baptist.
Jesus says, "What do you think? A man had two sons; he went to the first and said, 'Son, go and work in the vineyard today.' The son answers, 'I will not,' but he later changes his mind and goes to work in the vineyard. The father also goes to his second son and tells him the same thing, to which the son says, 'I go, sir,' but then he did not go. Jesus then asks, 'Which of the two did the will of his father?'" (Matthew 21:31)
The religious leaders of course say, "The first," to which Jesus says: "Truly I tell you, the tax collectors and the prostitutes are going into the kingdom of God ahead of you. For John came to you in the way of righteousness and you did not believe him, but the tax collectors and the prostitutes believed him; and even after you saw it, you did not change your minds and believe him." (Matthew 21:31-32)
John the Baptist's message was, "Repent, for the kingdom of heaven is at hand." (Matthew 3:2)
Specifically, John the Baptist told the religious leaders, "Bear fruit worthy of repentance. Do not presume to say to yourselves, 'We have Abraham as our ancestor'...Even now the ax is lying at the root of the trees; every tree therefore that does not bear good fruit is cut down and thrown into the fire. I baptize you with water for repentance, but one who is more powerful than I is coming after me; I am not worthy to carry his sandals. He will baptize you with the Holy Spirit and fire." (Matthew 3:8-11)
Repentance is not an action someone does frequently, because repentance is a complete change of actions and thoughts. When someone repents, it is as if they were walking in one direction and then turn around to go in the opposite direction.
In the context of these passages, repentance is going from the path of sin to returning to the path of righteousness.
Of these two different paths, Jesus says, "Enter through the narrow gate; for the gate is wide and the road is easy that leads to destruction, and there are many who take it. For the gate is narrow and the road is hard that leads to life, and there are few who find it." (Matthew 7:13-14)
Of the Pharisees, Jesus says, "Woe to you, scribes and Pharisees, hypocrites! For you tithe mint, dill, and cummin, and have neglected the weightier matters of the law: justice and mercy and faith." (Matthew 23:23)
In John's message, he was calling for the repentance of all sinning. Those who repented stopped their sinning and began living righteously. For more information on this subject, read about the Meaning of Repentance and Salvation.
When Jesus tells this parable of the two sons, and makes this statement about the religious leaders not believing John, he is saying that those who were tax collectors and prostitutes believed John and repented. They stopped sinning, which means the tax collectors stopped abusing the tax system to steal money and the prostitutes stopped being prostitutes.
These people are therefore entering the kingdom of God ahead of the religious leaders, because they did not believe John and did not repent. Jesus is calling the religious leaders sinners, saying that they did not stop sinning like the tax collectors and prostitutes did.
In Matthew 23, Jesus specifically tells the religious leaders what their sins are, saying they do not practice what they teach (calling them hypocrites) and listing several examples of their sins.
The religious leaders are the son who says "I go, sir" but then does not obey the father. Jesus is telling them that having the intentions to obey God is not enough for salvation. Obedience is what matters, not intentions. It is only those who actually obey God who are doing the will of their father.
As Jesus says, "Not everyone who says to me 'Lord, Lord,' will enter the kingdom of heaven, but only the one who does the will of my Father in heaven." (Matthew 7:21-23)
Obedience and disobedience are based on our actions.