I had a friend once ended a friendship with me because his increasingly strong faith, coupled with his religious doctrines, told him not to associate with others who lacked the same orientation. He was sorry to do so, and he hoped that I understood.
I did understand that he could rationally decide that his soul was more important our friendship, and act on that decision, regretfully.
We’ve discussed shunning in the most perjorative light, where a cabal decides not to associate with filth while suppressing shudders of revulsion at the very thought. We’re flirting with a straw man here. My brother-in-law is a JW who was shunned; he took me to my driver’s licence test, and as we sat in the waiting room, he pointed to another occupant who was a member of his church, who had known Terry his whole life, and very pointedly did not acknowledge his presence.
Later, Terry married my sister, and Terry rejoined the church. The shunning ended, and they’re very welcome there now.
Yes, organized shunning can be incredibly harsh on the shunned, and have the effects described in other posts. However, it can be done for sincere and not necessarily hateful reasons that are religiously (or otherwise) motivated. Thus, banning shunning certainly does intrude, not only on freedom of association, but freedom of religious expression. It isn’t necessarily a hate crime. It isn’t necessarily harassment. While the effect may be the same, the intention is not (in all cases).