It is okay to be friends with people who have differing opinions—even if they oppose your core values. I believe that the foremost priority is to have a good judge of character. If you deem someone a kind person, but they have opinions that you deem malicious, it is dangerous to shun them for it.
If you shun people for differing opinions, you push these people further down the “wrong tunnel”. You and your ideology become the enemy for these people.
Moreover, rejecting people with differing opinion kills perspective diversity in your life. We, the curious, know better than to do that.
I find this happens often with politics. Often with people in the left wing. The shunning of people with differing opinions stops growth on both sides, and villainizes eachother.
Please be willing to make friends with diverse and possibly wrong opinions. Maybe they don’t know any better, maybe they do. In the end, the key is to have empathy and judge people for kindness.