There are a number of themes, but the overriding one is mortality. Tolstoy believes that we can only truly lead meaningful lives if we gain a deep, spiritual understanding of that mortality which is our common human fate. Yet as the story begins, Ivan has no understanding of this. He's led a crushingly inauthentic life, one characterized by materialism, self-interest, and an obsession with the fleeting moment, the here and now. In other words, he has no true sense of his own mortality; he acts like he's going to live forever.
Ivan's spiritual life is nonexistent. And when he begins to experience the pain and torment of his physical ailments, he has nothing to fall back on; he cannot transcend the intense pain and the misery it causes. But eventually wisdom comes to Ivan Ilyich. He realizes that every single one of us is a synthesis of the material and the spiritual. He has spent the whole of his life up to this point living a purely material existence. Now, at long last, he is rediscovering the spirit within. And this rediscovery floods his heart with joy.
Ivan Ilyich's death ultimately comes to be seen as a regaining of lost spirituality rather than the simple expiration of his last breath. It has a qualitative dimension, one dependent on our constitution as not just physical creatures in a world of nature, but as profoundly spiritual beings whose deaths ultimately matter.