Ryan Andresen had recently completed the requirements to earning his Eagle Scout award, including his final project of building a "tolerance wall" for victims of bullying like himself, but his Scoutmaster would not sign off on honoring him with the Boy Scouts’ highest ranking because he is gay, his mother said.

And late Thursday, the Boy Scouts of America said in a statement that because of Andresen's sexual orientation and that he did not agree to Scouting’s principle of "Duty to God," “he is no longer eligible for membership in Scouting.”

The Boy Scouts of America have a longstanding policy denying membership to gay leaders and Scouts, which they reaffirmed earlier this year after a two-year confidential review of the controversial ban. The Scoutmaster for Troop 212 in Moraga, Calif., told Andresen’s father, Eric, the troop's chief administrator, on Sunday that Ryan wouldn’t be able to get the award, his mother, Karen, and Eric Andresen, 52, told NBC News.

“I want everyone to know that [the Eagle award] should be based on accomplishment, not your sexual orientation. Ryan entered Scouts when he was six years old and in no way knew what he was," said Karen Andresen, 49, a stay-at-home mother of three. "I think right now the Scoutmaster is sending Ryan the message that he’s not a valued human being and I want Ryan to know that he is valued … and that people care about him.”

Ryan, 17, came out in July. Andresen said the Scoutmaster knew about Ryan's sexual orientation and they had no idea he wouldn't sign off on the paperwork.

It was “a total shock," she said, adding that Ryan was led all along to believe he would be able to get the award.

The Scoutmaster did not immediately respond to a phone call and email seeking comment.

But a spokesman for the Boys Scouts, Deron Smith, told NBC News in a statement that Andresen recently "notified his unit leadership and Eagle Scout Counselor that he does not agree to Scouting’s principle of 'Duty to God' and does not meet Scouting’s membership standard on sexual orientation. While the BSA did not proactively ask for this information, based on his statements and after discussion with his family he is being informed that he is no longer eligible for membership in Scouting.”  Read more at NBC News