Only Endorsement/Opposition is Banned
The IRS regulations for non-profit groups ban political intervention that takes the form of endorsement or opposition to candidates. This does not mean all types of political activity are forbidden.
Pastors can speak out on issues all they like. They can be pro-choice or pro-life, for gun control or against it. They can push for higher or lower taxes, praise same-sex marriage or condemn it. Issue advocacy is permitted.
Churches can sponsor non-partisan voter registration and encourage voting as good civic behavior. They can hold "meet the candidates" night where all candidates for a given office are invited to speak and answer questions. Pastors can write to candidates and urge them to adopt certain political positions.
Since there is so much houses of worship may legally do in the political arena, there is no need for them to lurch over the line and endorse or oppose candidates.
