'Churches' (this is a short reply so I don't have the definition handy) actually get additional benefits on top of a 501(c)3.
Specifically, if they follow certain rules they don't even have to file a proper return. They still have to throw some numbers the way of the IRS, but in addition to not having to file, religious orgs do not have to publish their returns (normal 501s must do so, part of the 'transparency' of their tax break is they must show CEO salaries, salaries of certain top paid employees, and other expenditures).
In many of these situations, the denominational office has sought approval from the IRS, and has an Employer ID number that appears in the nonprofit search. https://apps.irs.gov/app/eos/ This is helpful for getting access to various corporate nonprofit donations. For example, Microsoft Office for nonprofits is very inexpensive.
The current restriction is based on a hastily worded amendment to the tax code from 1954 by one Lyndon Baines Johnson, who later became president when JFK was murdered.
It reduces to a few principles.
1. orgs should use their tax-deductible contributions in support of their stated missions.
2. orgs cannot be set up for "selfish" reasons. Because of the present and historical culture of graft (the buying and selling of political favors) in the US, we basically assume that anybody who promotes a candidate gets something in return.
3. confusion in the US Senate in 1954 about the difference between an org's "primary" mission and other missions.
There's also an undercurrent of church-state separation. By dollar volume, houses of worship are very big recipients of tax-exempt contributions. Politicians fear the influence of people in pulpits, so it's easier to prohibit that.
In May 2017, the current president, Donald Trump, issued an executive order weakening the restrictions on political speech. He did this under pressure from his political party and from the "evangelical" churches who support him.