Same thing happened to me. A friend of over 40 years - going back to high school - with whom I shared political, religious, and social views suddenly became rabidly liberal. He’d recently had a mild heart attack and, at first, I wrote it off as the somewhat normal change in personality that occurs after a heart procedure, but it continued to get worse. I tried to talk to him, but it reached a point where the negativity was too much. I politely wrote to him to say that life is too short (and he should be painfully aware of this) and that relationships should mean more than ideology. I pointed out I have several close friends on the other end of the political spectrum, but we choose friendship over conflict. Alas, we’ve not spoken in a few years, and I miss him but I choose to surround myself with love not anger.
My best and most loyal friend in life (apart from my husband) was a Democrat lady with very different views on almost everything. Ideology never touched our affection for each other.
On the other hand, I’ve lost friends - especially from very young days - simply because of divided loyalties, realizing that they weren’t what I thought in terms of character, etc. (I did have two friends I distanced myself from precisely because they were very morose and negative, and I don’t need that influence in my life.)
People just change and move on - especially as they mature beyond school/college/being single, etc. It happens to everyone at some point.
There’s always the opportunity to make new and more meaningful friendships. When you do, you often see exactly what was wrong with the old, lost ones and don’t miss those so much.