There's a relationship between depression and obsessional thinking.
It never was an immediate death sentence. The effects of HIV infection are slow and occur over years. There are cases where people find that the virus has become adapted such that the medications are no longer effective, either after a while or earlier on. I have heard that some of the side effects of the medication used can be a real b#&! As well. I suspect some serious depression with some kind of awful event whether a relationship breakup from hell or something unfortunate happened which broke him on top of his already big issues with depression.