President Barack Obama on Wednesday signed a defense bill which includes a “conscience” provision which protects troops from being punished for their beliefs.

Obama called the provision, known as Section 533, “unnecessary and ill-advised” in his signing statement.

“Section 533 is an unnecessary and ill-advised provision, as the military already appropriately protects the freedom of conscience of chaplains and service members,” Obama said. “The Secretary of Defense will ensure that the implementing regulations do not permit or condone discriminatory actions that compromise good order and discipline or otherwise violate military codes of conduct.”

Soon after repeal of “Don't Ask, Don't Tell,” some House Republicans began arguing that without protections in place service members who disagree with open military service would be punished and that chaplains would be forced to marry gay couples.

Section 533, however, is a watered-down version of outgoing Rep. Todd Akin's proposed amendment, which also prohibited the weddings of gay couples from taking place on military bases.

A bipartisan group of House and Senate lawmakers agreed to include Section 533.