Google canceled a companywide meeting about diversity just before it was set to begin Thursday, citing safety concerns after right-wing commentators published the names of certain employees.

Google Chief Executive Sundar Pichai had scheduled the meeting in the wake of his firing this week of software engineer James Damore, who wrote and distributed a memo that argued biological differences between men and women explain the gender gap among tech workers.

Shortly before the highly anticipated meeting’s scheduled 4 p.m. start in California, Mr. Pichai said in an email to staff that Google decided to cancel after employees expressed concerns “about their safety and worried they may be ‘outed’ publicly for asking a question in the Town Hall.”

“In recognition of Googlers’ concerns, we need to step back and create a better set of conditions for us to have the discussion,” Mr. Pichai said, adding that the company would find other ways to gather and engage employees on the subject in the coming days.

Google’s firing of Mr. Damore has sparked debate within Google and nationwide about the company’s diversity program and whether it is intolerant of conservative viewpoints. Executives were expected to face difficult questions from employees upset over the firing at Thursday’s meeting.

The firing has also drawn the ire of some far right-wing commentators, who in recent days have harassed online Google employees who publicly supported the firing. A Google spokeswoman on Thursday pointed to several instances in which these commentators posted the names and photos of some employees on social media and ridiculed them.

The spokeswoman said the names of other employees who had proposed questions for Thursday’s meeting also were leaked outside the company—though not posted online—which caused the company to worry those employees could be targeted if the meeting proceeded.

Google employees are split over management’s dismissal of Mr. Damore, according to interviews and informal polls of employees.

Some employees say Google executives didn’t go far enough to denounce Mr. Damore’s stance. Others say it is difficult to openly discuss diversity issues at the company because of a liberal bias among managers and colleagues at Google, a unit of Alphabet Inc. And one employee said his managers’ reaction to Mr. Damore’s firing “has made it explicitly clear that any view not left [of] center is not welcome.”

The variety of responses reflect that there are many conservatives and libertarians among the employee ranks at tech firms, even though they are seen as predominantly liberal. At Alphabet, which has nearly 76,000 employees, Mr. Damore’s firing has posed a test for how employees’ views compare with their co-workers’, inflaming feelings still raw from the divisive presidential election, employees said.

At the meeting, executives had planned to field employees’ questions voted on by their peers. The questions with the most votes would get asked.

A sampling of some of the most popular questions as of Tuesday, according to employees, reflects the spectrum of views on the memo and its fallout. One question asks how Google will protect female employees who have been harassed online for criticizing the memo. Another asks whether Google lowers the bar for diversity candidates. Some questions complain about how conservatives aren’t welcome at Google. And one asks how Google plans to stop leaks to the press.

A person familiar added that an additional top question was: “What can we do to clarify for the entire company that there is one hiring bar,” regardless of race or gender?

There are “definite mixed feelings” inside the company, one employee said. “There are people of all political stripes, and there’s outrage at the extreme of both ends of the spectrum and more sanity in the middle.” Moderate liberals at the company don’t believe the memo threatens the rights of women at the company, while moderate conservatives don’t think Mr. Damore’s firing means they can’t express themselves, this employee said. “But ultimately the loudest voices on the fringes drive the perception and reaction.”

Mr. Pichai said in the email Thursday that he had heard from many employees. “The vast majority of you are very supportive of our decision. A smaller percentage of you wish we would do more. And some are worried that you cannot speak out at work freely,” he wrote.

In the mobile app Blind, where users must use their work email addresses to verify they are employees at a given company, a survey of Google employees reflected the divisions. Of 440 Google employees who responded to a Blind survey on Tuesday and Wednesday, 56% said they disagreed with Google’s decision to fire Mr. Damore.

Mr. Pichai said in an email to employees Monday that Mr. Damore’s memo violated company policies “by advancing harmful gender stereotypes in our workplace.” But he added that “we strongly support the right of Googlers to express themselves, and much of what was in that memo is fair to debate, regardless of whether a vast majority of Googlers disagree with it.”

Google’s diversity and inclusion program is a major priority at the company, employees say, with managers tasked with hiring more minorities and women, or at least showing efforts to do so. The program was in part sparked by poor happiness ratings among women and minorities at the company in annual surveys, one employee said. Google said in June that 69% of its staff were men, 56% were white and 35% were Asian.

One employee said he disagreed with Mr. Damore’s memo, which he called “academic harassment,” and supported his firing, noting “people have been fired for a lot less.” But the employee said the diversity program risks breeding dissent among the mostly white and Asian male staff, and he agreed with Mr. Damore that open discussion isn’t possible at Google.

“There are some topics that are off limits, including gender and racial diversity,” he said.

Another employee said she feels comfortable discussing the diversity program with colleagues “but I’m in the majority that thinks they’re fair and necessary. I’d imagine if you weren’t confident diversity outreach had value you would be concerned that voicing it would offend your other co-workers who joined through those programs.”

Google’s liberalism was clear at an internal town-hall meeting after the presidential election, where top executives commiserated with employees over Donald Trump’s victory, according to a recording of the meeting viewed by the Journal. Alphabet Chief Financial Officer Ruth Porat, who publicly supported Hillary Clinton, called the election results “a kick in the gut.” Executives fielded a variety of questions over the hourlong meeting but none of the questions were in support of Mr. Trump’s victory.

Eileen Naughton, Google’s human-resources chief, said at the meeting that she was pleased to see employees holding spontaneous support groups after the election. But she added she had heard from conservative employees who “haven’t felt entirely comfortable revealing who they are … So I believe we need to do better. We need to be tolerant and inclusive.”

—Greg Bensinger, Deepa Seetharaman and Georgia Wells contributed to this article.

Write to Jack Nicas at jack.nicas@wsj.com