Even America’s psychologists — the people tasked with knitting people’s psyches back together — are fighting over politics. And the battlefield is their role in the nation’s war on terrorism.

Meeting in San Francisco on Wednesday, a leadership group of the American Psychological Association, the industry’s largest professional organization, voted 105 to 57 to continue to ban military psychologists from treating prisoners at the Guantanamo Bay detention center in Cuba, where the U.S. is holding foreigners it suspects of being terrorists.

The organization imposed the ban in 2015 to prevent military psychologists from working in “settings where persons are held outside of, or in violation of, either international law … or the U.S. Constitution.”

The association imposed the ban on military psychologists after a report it commissioned found that some had helped torture detainees to try to obtain information on terrorist operations.

The association has continued to allow psychologists to work at Guantanamo if they are brought in by detainees’ lawyers or a third party, such as the International Red Cross. But proponents of allowing military psychologists to resume treating detainees say none has visited the prison since the ban went into effect, depriving inmates of mental health care. They argued that military psychologists would be able to provide ongoing treatment that currently isn’t happening.

Sally Harvey, a retired military psychologist who supported lifting the ban, said Wednesday that “this is about providing detainees access to psychological treatment. Nothing more, nothing less.”

The organization’s decision Wednesday means that “detainees won’t get care,” Harvey said.

But Jeanne LeBlanc, a neuropsychologist who supported keeping the Guantanamo ban celebrated Wednesday’s vote by the APA’s Council of Representatives, its governing body.

“The message that the APA sent is that it is on the side of positive social change,” LeBlanc said.

The organization’s president Jessica Henderson Daniel declined to comment Wednesday on the decision.

Only 525 of the organization’s 115,700-members identify themselves as military psychologists who work for a branch of the armed services. The organization has been debating the ethical questions of working at Guantanamo for more than a decade, but the issue took on greater urgency after President Trump gave indications he would reverse the U.S. decision to back away from torture as a tactic in interrogations of terrorism suspects.

In January, Trump signed an executive order that promised to keep Guantanamo Bay open. He pledged to “load it up with some bad dudes.” At the height of the George W. Bush administration’s military operations against terrorism, hundreds of inmates were imprisoned at Guantanamo. Even though no prisoners have been sent there in more than a decade, 40 remain in captivity.

During the 2016 presidential campaign, Trump said he “would bring back waterboarding, and I’d bring back a hell of a lot worse than waterboarding.”

Earlier this year, Trump named Gina Haspel as director of the CIA. She was involved in the agency’s program of torturing terrorism suspects and oversaw sites in Thailand where detainees were held. Later, she supported destroying video footage of torture sessions.

Some opponents of the psychological group’s proposed policy change suspected the move was rooted in the fact that the Pentagon is the nation’s largest employer of psychologists. The military services employ 8,000 mental health experts in staff and consulting roles, according to the association.

“The military has a lot of power and influence in our culture,” said Stephen Soldz, a professor at the Boston Graduate School of Psychoanalysis who began lobbying the psychological association 12 years ago to bar members from being involved at Guantanamo.

Changing the policy “will be seen as a validation for Guantanamo and the position of this administration,” Soldz said before the vote.

A group of psychologists who opposed dropping the ban called the idea “especially troubling ... insofar as the administration has signaled its desire to return to and enhance Guantanamo’s worst abuses.”

The group, Alliance for an Ethical APA, mounted a political campaign-style operation aimed at derailing the change. It circulated a video to members that featured somber images of detainees, and secured letters of support from nine human rights organizations including the American Civil Liberties Union.

Supporters of the change said they don’t support torture. They want to make sure detainees have access to a psychologist. Currently, detainees have access to psychiatrists for their mental health needs.

But typically, psychiatrists “focus on pharmacology and don’t do talk therapy or behavioral therapy,” said Mark Staal, a retired Air Force military psychologist who supported lifting the ban.

Backers of the change conceded that Trump’s outspoken positions “have clouded the issue.”

“It’s not about torture. It’s not about President Trump,” said Harvey, the retired military psychologist. “Lost in all the politics is that this is about the detainees.”

Joe Garofoli is The San Francisco Chronicle’s senior political writer. Email: jgarofoli@sfchronicle.com Twitter: @joegarofoli