Shortly after taking up his post as American ambassador to the Dominican Republic in November 2013, Wally Brewster got a bit of unsolicited advice from the Vatican’s envoy to the Caribbean nation.

“If you keep your private life behind the walls of your embassy, you’ll be O.K. here,” Nuncio Jude Thaddeus Okolo told Mr. Brewster. He meant that Mr. Brewster, to be an effective diplomat, would be wise to keep his husband, Bob Satawake, out of sight in a country where prejudice against gay people remains widespread.

The advice went unheeded. Mr. Brewster and Mr. Satawake, who have been together for nearly 28 years, have been out and proud in Santo Domingo, sparking a spirited debate that has galvanized the nation’s fledgling gay rights movement and outraged local leaders of the Catholic Church.

The attacks against Mr. Brewster, a Chicago businessman who raised money for President Obama’s re-election campaign, began just days after the White House nominated him for the post. During a news conference in June 2013, Cardinal Nicolás de Jesús López Rodríguez, the archbishop of Santo Domingo, said he was appalled that Washington would be represented by a “maricón,” a slur term for gay men. Monsignor Pablo Cedano, another senior church leader, predicted that Dominicans would make Mr. Brewster so miserable, he wouldn’t last long.