The art of living well and the art of dying well are the same.
If we live wisely, that is, to live in pursuit of worthwhile things, such as close knit family relationships, good friendships, love, trust, compassion for our fellowman, and hold these things close to our hearts, and live for these things, we have lived wisely and well, as it is these things which bring us true happiness. It is unwise to live merely for the "surface" things in life such as social position and wealth. These things are merely trivial, and bring us only temporary, meaningless pleasures. To live our lives in this selfish shallow kind of way only ensures us a lonely death. I don't believe this is living well or wisely.
Ivan Ilich died as he lived. He lived a life where social status and wealth were his priorities, he did not live fully, enjoying important things which existed in his life, such as his family and friends. He was a selfish and shallow man, living totally in pursuit of higher social standing, wealth, and the joy he obtained from playing cards. As he was slowly dying, he experienced a painful, lonely death. He was not given the understanding and compassion which he so needed during his illness and eventual death. It makes sense to me that he died as he had lived, never giving love and compassion to his family or fellow man, and this is how he died.