Barack Obama has drawn stinging criticism for addressing an annual National Prayer Breakfast today organised by a Christian evangelical group whose members include the Ugandan politician behind legislation to execute gay people.

Obama spurned calls from ethics and gay rights groups to boycott the event run by the Fellowship, an organisation characterised by critics as a secretive, elitist group that wields influence through religious gatherings sometimes funded by defence contractors and foreign powers.

The organisation is headed by Doug Coe, who critics say has praised the organising abilities of Hitler and Osama bin Laden.

Among the Fellowship's members is David Bahati, a Ugandan MP who introduced legislation that would impose the death penalty on gay men who have sex with a partner under the age of 18. The Ugandan president, Yoweri Museveni, is also associated with the group, as are more than a dozen members of Congress and senior military officers.

Citizens for Responsibility and Ethics in Washington (Crew) wrote to Obama and other politicians appealing to them not to participate in the prayer breakfast, which has been attended by every president since 1953. Tony Blair, Mother Teresa and Bono are among previous speakers.

In its letter, Crew says the organisation "operates under a veil of secrecy concealing the source of its funding, its financial holdings and its political goals".

Crew's director, Melanie Sloan, acknowledged that the prayer breakfast had been held for half a century without controversy but said that its association with Bahati and the secrecy of the Fellowship – in contrast to Obama's commitment to open government – has opened the organisation to scrutiny. She said the prayer breakfast is often misconstrued as an official event because of the presidential seals strategically placed around the room.

"This is a fund­raising event and he's giving it legitimacy even though it has incredibly intolerant views," she said. "The White House says that every president does this but that's like a child saying it does something because everyone else does."

The Fellowship also operates the C Street House on Capitol Hill, which serves as a rehabilitation centre and retreat for those described by Crew as "ethically troubled" members of Congress.

They include Mark Sanford, the South Carolina governor who briefly disappeared to Argentina with his mistress, and John Ensign, a Republican senator being investigated by the FBI and a congressional committee over financial and ethical violations related to an affair.

The Fellowship's backers have defended it as giving spiritual support to national leaders. Hillary Clinton called Coe "a genuinely loving spiritual mentor and guide to anyone, regardless of party or faith, who wants to deepen his or her relationship to God".

Gay rights groups also condemned Obama's attendance and organised alternative prayer sessions.

In his speech, the president pointedly challenged many in the audience by repeating his administration's condemnation of Bahati's proposed legislation. "We may disagree about gay marriage but surely we can agree that it is unconscionable to target gays and lesbians for who they are, whether it is right here in the United States or as Hillary [Clinton] mentioned more extremely in odious laws that are being proposed most recently in Uganda," he said.

Obama's attendance disturbed some liberals because the president has generally avoided the setpiece religious requirements of the position such as choosing a church in Washington. He has attended services just four times when most presidents worshipped weekly.He added that he has been sustained by faith and prayer. "I assure you, I'm praying a lot these days," he said.