I believe the passage you are questioning is Matthew 7:21—from the Sermon on the Mount: "'Not everyone who says to me 'Lord, Lord' shall enter the kingdom of heaven, but he who does the will of my Father who is in heaven.'"
We begin by realizing that the kingdom of heaven was, for Jesus, not a place of bliss to be enjoyed after death. He taught that the kingdom of heaven is actually at hand. It is within us. It is a rich and joyful life experience that will result from choices we make—choices that are rooted in the Christ Presence of God within us, rather than choices rooted in our fear-based belief in separation and limitation.
Jesus is communicating this radical new understanding of our relationship to God to people who were raised with a belief that the right words, the proper rites and rituals, the outer forms of religious behavior would guarantee their place in that kingdom. He is telling them—as he does repeatedly throughout his ministry—that the kingdom will only be achieved when the choices they make in life—how they treat others, how they see themselves, what priorities they embrace—reflect and express their innate Oneness with all that God is. We don't achieve the kingdom by saying the right words and waiting for it to appear. We create the kingdom by making loving, empowering choices that bring it into expression.