"Shun" is a slippery word. If a person I know steals from me when he is in my home, I might avoid that person (and "shun" is a synonym in this case for "avoid").
Shunning as a practice is for a whole group (a family, a religious faith, a society, &c) to control or modify behaviour, or to punish a person. Some psychologists consider this form of avoidance or control to be torture. (Torture does not have to solely inflict physical pain; psychological pain can be terribly debilitating, including driving people to suicide.)
Several religious faiths formally practice shunning for the purpose of controlling members, preventing people from deviating from religious teachings, or punishing people who have deviated. When formally practiced, it is ecclesiastical authorities who tell members to no longer associate with the shunned member. Shunning usually includes total exclusion from society and frequently from families.
In Christianity, shunning is based on several passages in the New Testament.
Religions that I know of that formally practice shunning:
- The Roman Catholic Church, which discontinued the practice of shunning of excommunicated members in 1986.
- The Baha'i faith shuns people for creating schisms within the faith.
- Chassidic and Orthodox Jews practice shunning. There are cases in the USA and Australia in this century of shunning members for reporting child sexual abuse to authorities.
- Jehovah's Witnesses shun members (called "disfellowshipping") for significant deviation from the teachings of the Watchtower Society.
- Mormons shun members for significant deviation from Mormon teachings.
- Mennonite churches ceased shunning in the 17th Century. That was the principal reason for the split creating the Amish (Old Order Mennonite) church. Amish today shun members who deviate from their teachings.
- Interestingly, there is no formal mechanism in Islam for shunning members. That said, in many countries a person accused of apostasy, heresy, or blasphemy might be cast out of a family, jailed, or killed. Blasphemy laws don't exist just in Muslim-majority countries however, Christian-majority nations also have them (even Canada has a blasphemy law).
Within Christianity, while few churches have formal shunning mechanisms, many Christians have informal shunning. When a person holds a position in opposition to nearly any faith's beliefs, members of that faith will avoid the person. In the USA in the case of the LGBT and atheists, family members will frequently cast out the offending family member, even when that person is a child. The idea of casting out members of the family is cruel, and fear of that keeps both gays and atheists "in the closet."
Much of my own family will have nothing to do with me today, just because I don't believe as they. As an adult, I can support myself and don't need their approval (though I still miss those family members—hence the concept of psychological torture). That avoidance is punishment for my apostasy.
Christians cast the idea of shunning as concern for the person's soul (if you accept Jesus, we'll accept you back in). That's extortion, not love.
As such, it is an apologetics fail, because extortion or threats are cast as love for the person, or love for the community. If in fact the family's or community's faith was unassailable, then no number of gays or unbelievers or whatnot should be able to shake their faith.
What shunning really does is display the hypocrisy of religious claims of loving your enemy (cast as love the sinner, hate the sin, and you love that sinning child so much you'll throw him or her out on the street to starve or cut the child out of your life completely). It also displays the hollowness of faith and the faithful (my ideas are so weak they cannot stand criticism, or I can be easily corrupted by a competing idea). That's not faith, that's fear.
And in churches and families that shun, it is fear that keeps the members in line, not love.