President Obama criticized a conscience clause in a defense bill that protects military chaplains who object to performing gay marriage.
The president signed the $633 billion bill into law on Thursday. It contains a clause exempting chaplains from having to perform same-sex weddings if they object because of their faith.
At the signing, the president said the conscience provision is 'unnecessary and ill-advised."
"The military already appropriately protects the freedom of conscience of chaplains and service members," Obama wrote in a statement announcing his signing of the bill.
"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," he said.
He added that he remains committed to "protecting the rights of gay and lesbian service members."
The Chaplain Alliance for Religious Liberty said the president "is not at liberty to disregard" the conscience protection in the law.