It is not a lack of love, compassion or mercy on God’s part that a person effectively condemns them self so that they are deprived of eternal life. It seems like there are many people today who find it difficult to accept this. For some it seems that God must be cruel to allow anyone to perish. This affects, of course, their understanding of divine mercy, and their understanding of the gift of free will.
In many ways the gift of free will is a terrible gift! Well it is both terrible and amazing rolled into one! Made in the image and likeness of God, human beings are given the gift of free will. Even when their minds are darkened by ignorance and attachment to sin, they still possess free will (although it can be diminished greatly once we form vices or addictions). It is a divine gift for us to have the freedom to do the good thing, to do the right thing, to do the sacrificial thing – in other words to be able to love as God loves. Love cannot be coerced. Deeds of love cannot be compelled. Freedom is the freedom to do the divine will, the right thing. But freedom also enables us to fall, otherwise it would not be a freedom of will. This freedom is what makes us culpable for our actions done in freedom. And the choices we make shape our character. Repeated good acts encourage a virtuous character; repeated sinful acts encourages vice.
So in freedom we are capable of actions that can result in the end to a deprivation of eternal life, as our Lord says in the gospel today (Jn 3:18). Divine mercy is the offering to human beings of a way out, a way to turn their lives in a different direction. Divine mercy resulted in our redemption, so that now by choosing to receive and cooperate with the grace of God, we can repent, be forgiven, grow in virtue, find true happiness and by grace, come to eternal life.
But our Lord is not lacking in mercy by saying that judgement results from the acceptance or rejection of the divine light – which is Jesus Christ. If we prefer the dark because we want to hide our sins, then we reject the light and thus the judgement is deprivation of eternal life. This is merciful justice because we have had the chance to choose another path but rejected it.
(See also the Catechism: CCC 219, 444, 454, 458.)