From The Gospel of Matthew by Curtis Mitch and Edward Sri, commenting on Matthew 21:28-23:
Obviously, the first son is the one who did his father’s will. Even the chief priests and elders recognize that. But what Jesus says next would have utterly dumbfounded them. Jesus tells them that the tax collectors and prostitutes will enter the kingdom of God before you. Tax collectors and prostitutes were considered at the bottom of the socio-religious scale, outside God’s covenant, the kind of people the chief priests and elders looked down on the most. Yet, like the first son, these notorious sinners, who rebelled initially, repented when they heard the exhortation of John the Baptist. That Jesus would say these sinful outsiders will enter God’s kingdom before the chief priests and elders would have been completely astounding—and offensive.