The parable Jesus told was about obedience. His instruction to the chief priests and elders in verse 31 was based on their correct answer to His question in verse 31: “Which son did His father’s will?”
He informed them that it was by their obedience to God that prostitutes and treasonists were entering the Kingdom of Heaven. He was not talking about going to Heaven when they died. That access had not been purchased with His blood yet, and when that did happen, was the only access.
As He informed some people who called the Holy Spirit “Beelzebub” in Luke 11, the Kingdom had already come to them (vs. 20). Entering it was possible through hearts that were surrendered to the will of God.