Mr. Trump, according to the officials, believes his decision to back Luther Strange — a struggling establishment conservative in the Alabama Senate race and the reason Mr. Trump went to Alabama — makes him appear weak. He has repeatedly expressed unhappiness with his political team for persuading him to back Mr. Strange, who has drawn opposition from many of Mr. Trump’s supporters, including Stephen K. Bannon, Mr. Trump’s former chief strategist, and not his opponent, Roy Moore, a former judge.

For those reasons, Mr. Trump leaned right harder than usual on Friday night. He chided Senator John McCain, Republican of Arizona, for opposing his latest attempt to repeal the Affordable Care Act, and he ridiculed North Korea’s leader, Kim Jong-un, as the “Little Rocket Man.” He also offered the most tempered of support for his purported ally, Mr. Strange — “Big Luther” to the president.

But his most conspicuous targets were the highly paid athletes, most of them black, who during the playing of the national anthem at football games have protested police brutality and what they say is the systematic racism behind it. The vehemence was tactical, but also visceral. Mr. Trump has often taken a dim view of race-based protest and, as the onetime owner of a football franchise in a failed start-up league, he believes owners of sports teams should control their employees.

His top staff was not nearly as enthusiastic, a senior administration official said. There were complaints from some officials that his tweets created another public relations headache at a time when the White House was scrambling to deal with a looming loss on health care, a dangerous escalation in the war of words with North Korea and complicated negotiations over the centerpiece of the president’s legislative agenda, tax reform.

But John F. Kelly, the White House chief of staff, dismissed such complaints, telling other aides he fully supported the president’s move and that there was no good time for such a conversation.

“Every American should take the three minutes or so that it takes for the national anthem to play to stand up, remove their hat, put their hand over their heart and think about the men and women that have been named, sacrificing their lives, so that song can be played in the stadium,” Mr. Kelly, a former four-star Marine general, said in a statement late Monday.