Not sure if this needs a religious trigger, but just in case......
In Buddhism, this concept is called
mudita, or Unselfish Joy. It's the capacity to find joy and happiness in the good fortune of another. It is considered the antidote to envy and jealousy, as well as condescension and patronization. It is also recognized to be a very complicated and difficult virtue to develop in oneself.
It seems that there are often plenty of opportunities for thoughts and deeds of pure compassion; but there seem to be all too few for sharing in others' joy. Good for you, CE, for recognizing this opportunity for growth and spiritual deepening. I hope that next time the circumstances arise, your mudita will be that much more developed.