People have it wrong. There is nothing wrong with you choosing to shun someone out of your own free will.
Problem here is that there is a third party causing the shunning and IMO that aspect could be legislated to be illegal and those organizations causing members to shun should be classified as cults, banned or at least lose their tax-free status.
If you belong to an organization and leave or get kicked out, sure you may not be allowed into the building but what you and other members do outside of that particular meeting/building should be non of the group's leaders business nor should they stop the active members from associating with you.
There is a difference between me choosing to shun someone because they did me wrong and me shunning someone because I have been taught or told to do so by organization/third party of influence.