The ban on political campaign activity by charities and churches was created by Congress more than a half century ago. The Internal Revenue Service administers the tax laws written by Congress and has enforcement authority over tax-exempt organizations. Here is some background information on the political campaign activity ban and the latest IRS enforcement statistics regarding its administration of this congressional ban.
In 1954, Congress approved an amendment by Sen. Lyndon Johnson to prohibit 501(c)(3) organizations, which includes charities and churches, from engaging in any political campaign activity. To the extent Congress has revisited the ban over the years, it has in fact strengthened the ban. The most recent change came in 1987 when Congress amended the language to clarify that the prohibition also applies to statements opposing candidates.
Currently, the law prohibits political campaign activity by charities and churches by defining a 501(c)(3) organization as one "which does not participate in, or intervene in (including the publishing or distributing of statements), any political campaign on behalf of (or in opposition to) any candidate for public office."
The IRS has published Revenue Ruling 2007-41 (PDF), which outlines how churches, and all 501(c)(3) organizations, can stay within the law regarding the ban on political activity. Also, the ban by Congress is on political campaign activity regarding a candidate; churches and other 501(c)(3) organizations can engage in a limited amount of lobbying (including ballot measures) and advocate for or against issues that are in the political arena. The IRS also has provided guidance regarding the difference between advocating for a candidate and advocating for legislation. See political and lobbying activities.
Each election cycle, the IRS reminds 501(c)(3) exempt organizations to be aware of the ban on political campaign activity. The IRS published its most recent reminder in a public news release which you can read here.
The division within the IRS responsible for overseeing churches and charities is the Tax Exempt and Government Entitities Division. TEGE has created a Web page entitled Charities, Churches, and Educational Organizations - Political Campaign Intervention. It is dedicated to the IRS most recent activities related to 501(c)(3) and political activity.
A definitive court case on the issue of free speech and political expression is Branch Ministries Inc. versus Rossotti (PDF). In that case, the court upheld the constitutionality of the ban on political activity. The court rejected the plaintiff church's allegations that it was being selectively prosecuted because of its conservative views and that its First Amendment right to free speech was being infringed.
The court wrote: "The government has a compelling interest in maintaining the integrity of the tax system and in not subsidizing partisan political activity, and Section 501(c)(3) is the least restrictive means of accomplishing that purpose."