Louisiana Republican John Fleming sponsored the legislation to keep out what he and other lawmakers called atheist chaplains.

"By definition, chaplains minister to the spiritual needs of our men and women in the armed services, a vital function that an individual without any inclination towards spirituality would not be able to perform," he said during debate on the proposal, according to The Hill.

Republicans who supported the amendment said people who don't believe in God don't want spiritual counseling. Some Republicans accused Democrats of wanting to install non-religious chaplains as part of an attempt to remove God from public life.

"My constituents back in Oklahoma are shaking their heads," said GOP Rep. Jim Bridenstine, according to The Hill.

"The secular left is so invested in ripping God from everything, that I must stand here with my friend Dr. Fleming to prohibit Obama's Department of Defense from establishing an oxymoron — atheist chaplains," Bridenstine added. "Why does the secular left insist on ruining the integrity of the chaplaincy to serve their agenda of institutionalized godlessness?"

Democrats said atheist or "humanistic" chaplains are necessary for non-religious military personnel who want counseling.

"Over 20 percent of the members of our military identify as non-believers, and while of course their needs should be catered to by members of the chaplaincy from diverse faiths, it is only fair to have their humanism or outlook represented," said Colorado Democrat Jared Polis.

Atheists in the military "wrestle with those same existential questions as those of us with faith," he said.

Georgia Republican Doug Collins, an Air Force chaplain, said he often counsels atheists who just want to talk about their problems, Fox News reported.

Atheists in the military don't have a need for atheist chaplains, given the other counselors available to them, including psychologists and psychiatrists, he said.

"They need to come at it differently instead of just saying we want an atheist chaplain. I think there's plenty of opportunities for them to talk."