“DON’T be evil” is Google’s corporate motto. If only it were so simple. The online-search giant is in a tricky spot after an employee published a long, anonymous memo online about why women are under-represented in the technology industry. The main reason may not be sexism, asserted James Damore, the young Harvard-educated software engineer later revealed to be the memo’s author, but biological factors. Women are more interested in people and emotions, he wrote, and tend towards “neuroticism”, meaning they are more anxious than men and worse at handling high-stress jobs.

The ten-page memo also lamented liberal Silicon Valley’s new willingness to “discriminate to create equal representation” and its reluctance to hear opinions that clash with the mainstream view on diversity. On August 7th Mr Damore told Bloomberg, a news service, that he had been fired by Google. Sundar Pichai, the company’s boss, said that portions of the memo violated its code of conduct and made its work environment hostile for female employees.

Mr Damore may have believed he was voicing what many people in the tech industry privately think. Silicon Valley has been plagued by allegations of sexism at startups, notably Uber, a ride-hailing company, as well as at venture-capital firms, which help set the male-dominated cultures of the young companies they finance. In July a handful of prominent venture capitalists, including Dave McClure, the general partner of 500 Startups, admitted to treating women inappropriately and resigned from their positions.

But Google has much more to lose. It is under investigation by the Department of Labour for discriminating against women by paying them less than men. Men occupy four-fifths of its directly technology-related roles, according to the firm (see chart). It needs to show its female employees and workers from ethnic and sexual minority groups that it does take diversity seriously. At the same time, Google’s search engine and its online-video site, YouTube, must remain platforms for free expression. But as Mr Damore’s sacking shows, there are limits to what its employees may say in public.