President Trump announced on Twitter this morning that he would be barring transgender people from serving in the U.S. military, reversing an Obama-era decision to lift the ban on openly transgender service members. Trump wrote, “Our military must be focused on decisive and overwhelming victory and cannot be burdened with the tremendous medical costs and disruption that transgender [sic] in the military would entail.”

While this issue has been far from the top of the national news, it has been a priority among Religious Right groups, who have undoubtedly made their position known to the president. When a bipartisan majority of the House rejected an amendment from Rep. Vicky Hartzler of Missouri that would prevent the Defense Department from providing gender reassignment surgeries and therapies for transgender service members, the Religious Right was livid.

At least one person in the Trump administration has already admitted a political motivation, saying the policy change will create an opportunity for social conservative groups to attack Democrats. “How will the blue collar voters in [Rust Belt states] respond when senators up for re-election in 2018 like Debbie Stabenow are forced to make their opposition to this a key plank of their campaigns?” an administration official told reporter Jonathan Swan.

If that’s the case, it’s because the Religious Right has worked diligently to demonize transgender people, even as it has lost battles on issues like marriage equality.

Soon after Trump was elected, the Family Research Council included ending the new transgender policy on its wish list of priorities for the Trump administration. FRC president Tony Perkins wrote in a fundraising email in December that he hoped Trump’s victory “could signal the end of the left-wing assault on our military.” In January, he said that he hoped that Defense Secretary James Mattis would bring back “an understanding of manhood and masculinity” to the military in a “culture that has been emasculated by the feminists and by the left.” Before the election, Perkins said it might be better to disband the military than to allow it to accommodate transgender service members.

As the House prepared to vote on the Hartzler amendment, the FRC ran a web ad with a photo of Chelsea Manning implying that the Pentagon faced a choice between providing gender reassignment surgery and paying for warplanes:

We’re running this ad in NY-23 to encourage people to tell @RepTomReed how they want the military to spend their tax $. Call 202-225-3161. pic.twitter.com/j6TjBVAXbC — FRCAction (@FRCAction) July 20, 2017

After the House rejected the amendment, FRC urged members of its pastor’s network to pray:

Heavenly Father, it is time for you to act, for your law is being broken! This policy must be rejected: it brazenly defies You, God our Creator, and Your fixed, eternal moral laws. We defied your definition of marriage, now we defy the very apex of your created order, mankind created in your own image, male and female. Please forgive us, extend Your mercy to us, and grant us repentance. You who bless nations that obey You, and curse nations that disobey you; You who promise battleground victory to those who obey you, but defeat to all who disobey, have mercy! Grant repentance to President Trump and Secretary Mattis for even considering to keep this wicked policy in place.

Perkins devoted multiple segments of his daily, nationally syndicated radio program to the issue, including interviewing one Republican congressman who warned that service members might pretend to be in the process of gender transition in order to get out of combat deployments.

Another group lobbying heavily for the ban’s reinstatement was the Center for Military Readiness, which was also one of the most virulent voices against allowing gays and lesbians to serve openly in the military. After the House vote failed, the National Organization for Marriage’s Brian Brown launched a petition aimed at the Republicans who had voted against it, writing in an email to supporters, “The military exists to defend the national interests of our country, not to help advance a dangerous social experiment in gender ideology that President Obama pushed on the country at the behest of LGBT extremists.” Religious Right groups including Liberty Counsel and the Heritage Foundation have also been pushing to roll back the policy.

While the Religious Right has focused its recent efforts on preventing the integration of openly transgender troops, it’s hardly a secret that these groups would prefer to reinstate the ban on gay and lesbian service members as well. Religious Right activist Matt Barber tweeted this morning: