“I want to apologize,” the Facebook executive wrote last Friday in a note to staff. “I recognize this moment is a deeply painful one — internally and externally.”

The apology came from Joel Kaplan, Facebook’s vice president for global public policy. A day earlier, Mr. Kaplan had sat behind his friend, Judge Brett M. Kavanaugh, President Trump’s nominee for the Supreme Court, when the judge testified in Congress about allegations he had sexually assaulted Christine Blasey Ford in high school. Mr. Kaplan’s surprise appearance prompted anger and shock among many Facebook employees, some of whom said they took his action as a tacit show of support for Judge Kavanaugh — as if it were an endorsement from Facebook itself.

The unrest quickly spilled over onto Facebook’s internal message boards, where hundreds of workers have since posted about their concerns, according to current and former employees. To quell the hubbub, Facebook’s chief executive, Mark Zuckerberg, last Friday explained in a widely attended staff meeting that Mr. Kaplan was a close friend of Judge Kavanaugh’s and had broken no company rules, these people said.