WASHINGTON — President Donald Trump earned no merit badge for his address to the Boy Scouts of America on Monday night.

The president got plenty of applause from the more than 30,000 Scouts, troop leaders and parents during his 38-minute speech at the National Scout Jamboree in Glen Jean, W.Va., along with chants of “USA!” and “Trump” and hearty boos at his references to former rival Hillary Clinton and his predecessor, President Barack Obama.

To many, that was the problem.

Almost immediately the 117-year-old organization was forced to respond to a barrage of complaints from former Scouts, other parents and the public that Trump’s speech violated Scout values with its partisanship and, at his start, profanity.

In a statement to news organizations late Monday, the Boy Scouts said its invitation to the president to speak was “a long-standing tradition and is in no way an endorsement of any political party or specific policies.”

Yet the protests kept coming Tuesday.

On the Facebook page of the Boy Scouts of America, one woman wrote, “Since when does this organization get involved in politics? In fact, isn’t it NOT allowed? Who let this happen? I can’t believe the Boy Scouts booed a living American President.”

The organization did not respond to requests for additional comment.

Trump began his remarks by telling the throng of youths that he would leave “the policy fights” and “the fake news” aside for the moment.

Yet even in making that pledge, he went off-script: “I said, who the hell wants to speak about politics when I’m in front of the Boy Scouts?”

Trump repeatedly departed from his prepared remarks on Scouts’ honor and American values, either to take a shot at some political foe and the press or to relive the glory of his election victory, or both at once.

He took swipes not only at Clinton and Obama, but also at his fellow Republicans in Congress and, pointing toward reporters at the event, “these dishonest people.”

Instead of a paean to public service typical of such events, the president told the teenagers that Washington, where his party controls both the White House and Congress, is “not a good place.”

Trump recalled the “beautiful date” of Nov. 8 when he won the election — “Do we remember that date?” he asked, to applause — and TV network maps were “so red” — for Republican state wins — “it was unbelievable.”

He relived his against-the-odds Electoral College tally of swing states, and castigated Clinton because she “didn’t work hard.”

He suggested that the Scouts contributed to his triumph, calling it “an unbelievable tribute to you and all of the other millions and millions of people that came out and voted for ‘Make America Great Again.’?”

Trump introduced his secretary of health and human services, Tom Price, and then threatened — jokingly, it seemed — to fire Price if he didn’t wrangle the votes to kill “this horrible thing known as Obamacare.”

He singled out West Virginia’s Republican Sen. Shelley Moore Capito, who has criticized previous versions of the health care bill, alluding to the Scout Law tenet to be loyal. “We could use some more loyalty, I will tell you that,” he said.

After some Scouts broke into a chant of “We love Trump,” he digressed to ask them, “By the way, just a question, did President Obama ever come to a jamboree?” Many yelled “No!” and he concurred, “The answer is no.”

Obama, who was a Scout as a boy, unlike Trump, sent a video greeting to the National Jamboree in 2010, the 100th anniversary of the BSA.

According to the organization, Trump was the eighth of the 11 presidents in its history to join the annual Jamboree, starting with Franklin D. Roosevelt in 1937 to, most recently, George W. Bush in 2005. While Ronald Reagan never attended, his wife Nancy Reagan did.

jackie.calmes@latimes.com