Republican lawmakers love to say they are protective of religious freedom and supportive of the military. Last week, Republicans on the House Armed Services Committee passed two measures that undermine both in an effort to deny equal rights to gay men and lesbians.

It was particularly disturbing to see this implacable campaign of intolerance at work during a week in which President Obama announced his support for the expansion of the right to marry to all Americans.

Just hours after Mr. Obama tried to lead the nation forward, the House Armed Services Committee was turning the clock back. On a 37-to-24 party-line vote, the committee approved an amendment to the annual military budget bill that would bar the use of a “military installation or other property owned or rented by, or otherwise under the jurisdiction or control of the Department of Defense” for a same-sex marriage or “marriage-like ceremony.”

This measure is a flagrant violation of the First Amendment’s guarantee of freedom of religion — a right that conservatives champion when it suits their political agenda. If, for example, a Navy chaplain wanted to perform a same-sex wedding, he would be prohibited from doing so in his chapel — even if it is in a state that recognizes same-sex marriages.