In another case of starting to write a comment and discovering that the response would be a full-blown post, Frank wrote this excellent post about how we treat people who do things that run contrary to our values. He speaks of these things as differences, but I think it is important to recognize that while some of the situations are mere differences, many are cases where one party views the difference as a matter of moral importance. The reason that I think this is important is that I think that people act differently when they fear for their own moral standing than when the difference has no moral bearing.
There seem to be two main reasons why people shun or harshly treat others who are, or act, differently. One reason is that they fear the difference because they do not understand it, the other reason is that they fear that they will become different themselves if they do not repel those who exhibit the differences in question. In the first case, the solution is education regarding the difference so that there is no longer a need to fear. In the second case there are situations where quarrantine may be appropriate, such as with lepers in Biblical times.
With regards to issues that are perceived as having a moral bearing understanding of oneself might be the best way to differentiate between cases where acceptance is the proper course and times when quarrantine is the more desireable course. For many young people in the LDS culture there are two conflicting messages regarding interaction with those who are different – one is to be an example and befriend others, the second is to avoid the appearance of evil and steer clear of corrupting influences (which can easily be perceived as, or even turn into, shunning). If a person understands their own strengths and weaknesses they can decide when it is best to try to befriend someone who does something contrary to their values and when to avoid someone who would have a detrimental influence on them.
For example, if Person A smokes (to take a real, but hopefully non-political example) and Person B objects to smoking, Person B can decide whether to avoid Person A if Person B has enough self-awareness to know if they have any temptation to experiment with smoking. If Person B has such a propensity then they have good reason to stay away from Person A and others who smoke in order to address their own weakness (the weakness of Person B). If Person B has no inclination to experiment with smoking then they need not avoid Person A. Considering the medical effects of second-hand smoke, Person B may still choose to avoid person A while Person A is smoking but otherwise they may quite safely interact with Person A.
To put it another (generic) way, if we understand ourselves and seek to understand the differences that we encounter in others, we will be able to determine how dangerous those differences are to us personally and we will be able to treat others with respect while still protecting ourselves from those differences which play to our own weaknesses.