Progressive blogs are full of outrage over a Baptist church in North Carolina that has excommunicated all its members who voted Democratic. A frequent comment is that the church is breaking the law and should at least lose its tax-exempt status. Those suggesting such drastic measures should perhaps think twice.
I am not a lawyer and don't know if the church broke the law, but comments written by lawyers tend to say it is unlikely. The church did not intervene in a political campaign; it has merely reacted, after the fact, to past political actions that cannot be undone. Unless it had threatened to do so before the last election, it probably did not violate the tax laws.
But a more important issue is, legal technicalities aside, should a religious institution be allowed to deny membership to those whose opinions it dislikes? I think it should; moreover, forbidding it to do so would be absurd. A religious congregation is based on a common set of beliefs. It cannot meaningfully exist if it has no right to set the criteria for membership, as long as the criteria are reasonably related to beliefs. If you accept this principle, you can still ban discrimination based on factors like race, which have nothing to do with beliefs; but one's political, moral, and other social views are often impossible to disentangle from one's religious beliefs; the church should then be free to consider them.