There will always be uncivilized people hell-bent on forcing their opinions down your throat. Just don't let them.
It's generally a bad idea to connect to colleagues on social media. Colleagues can become friends but don't start out that way and most workplace relationships never reach that point. Thankfully, most networks have a simple silent block and/or ignore feature. This will make sure your posts are hidden from that connection and you don't see their updates while not actually "defriending" them. Do that if you're uncomfortable with possible backlash. I'd argue that you'd be doing humanity a favour if you defriended him and explained, if he asked, that you prefer not to see the kind of remarks he makes. If you want to avoid a hostile reaction but still want to defriend him, you can also just explain with: "I've realised that I want to keep my professional and social life separate."
Now, the social network comments aren't really a workplace issue but if he's making disparaging remarks about your (or indeed any) religion, then that's a bigger problem. The best thing you can do is to directly say to him that it's not okay and you don't want to hear any more:
I understand that you feel strongly about [your religion] but I don't want to bring such a loaded topic into the workplace and would prefer if you not bring it up [around me / at work].
After that, whenever he starts mouthing off again, react in the moment and shut him down by saying one of the following:
I mentioned before that I don't feel comfortable discussing religion in the workplace. Could you please refrain from bringing it up again?
I'd prefer not to discuss it.
I'm sorry you feel that way but I'd rather not bring this up again.
Wow. [a very effective response in many cases]
Repeat ad nauseam. If he keeps bringing it up, even when he's not directly talking to you, you need to escalate this. Go to your manager or directly to HR and mention what's been going on and that you tried to resolve it without success. In most countries, this kind of behaviour is not tolerated and in most Western countries it can have legal consequences. However, I don't know your company and the culture involved. If you know that you'll only get negative reactions for escalating this, you may have to just grit your teeth and ignore it. That wouldn't be fair but you may not want to risk damaging your career over one person's stupid remarks.
Note: OP is from India but I'm not familiar enough with its employment laws to say whether there's anything useful there. India's Constitution has some relevant articles but as far as I know nothing approaching the protections in place in the US and Europe.
My answer assumes that this colleague is speaking directly to you or trying to bait a reaction from you. If that's not the case, you can either write him off as the boor that he is and ignore him, or you can follow Allison Green's advice:
Please speak up. Say something like this to your coworker: "This has
been bothering me for a few days, so I wanted to speak to you about
it. The other day, I overheard your conversation with Jane about
Caitlyn Jenner, and what I heard was disrespectful and unkind. I can’t
make you think differently, but I want to ask you not to make comments
like that in the office."