Is there a duty, even for those who fear how President Trump governs, to serve in the administration? The debate, which began after Mr. Trump’s election, has often been revisited during his presidency, most recently when Rachel Brand resigned this month as associate attorney general. She said that she did it solely to take a “dream job” as Walmart’s top lawyer, but it’s easy to imagine that she also left because of the stress of serving in the Trump administration’s Justice Department.

If so, she is not the only one finding government service difficult at this time. Even under the best circumstances, the hours for senior officials are often long and the pay is low compared with what colleagues in the private sector earn.

Under Mr. Trump, the challenges are particularly daunting. The president and his senior advisers have little use for government professionals. Agencies from the State Department to the Bureau of Prisons are understaffed. The president has crossed once-bright ethical lines, refusing to release his tax returns or to completely dissociate himself from his business while hiring family members for critical positions.

Most disturbingly, the president and his surrogates often attack government institutions, including many that are among America’s most respected. Mr. Trump declared the F.B.I. and the Justice Department “disgraceful” and even singled out some public servants by name. Most recently, it was his national security adviser, Lt. Gen. H. R. McMaster, after he accused Russia of “disinformation, subversion and espionage.” The president promptly called him out in a tweet because the general “forgot to say” that it was “Crooked H, the D.N.C. and the Dems” who colluded with Russia.