Several of my female friends working in various industries have recently expressed a similar disheartening sentiment: “It’s not that I prefer male bosses, but they’re the only ones who give me opportunities and successfully fight for me.”

The first time I heard this, I was outraged, but soon I started to worry if this is a belief that actually undermines female leadership. It’s troubling in a couple of ways, but most of all, how can female managers succeed if those who report to them don’t trust their ability to navigate workplace power structures? Put more pointedly, what if talented employees prefer and benefit from male leadership because professional culture enables men to have an edge in getting things done?

One of the common strategies for achieving greater gender and racial diversity in the workplace is to promote more women and people of color to leadership roles, in the hope that such people will promote diversity from within. In theory, women and minority leaders are likely to think about diversity more when making personnel decisions. They’re also thought to be better at identifying talented but overlooked job candidates and may push for workplace policies that could enable those women and people of color to thrive.

Is this how things play it out in reality? David Hekman, an associate professor at the University of Colorado’s Leeds School of Business, studies the ways businesses manage their employees, and specifically keeps an eye on gender and racial biases at work. “It always baffled me that my nonwhite and female coworkers would put up with what I perceived to be blatant racist/sexist comments in the workplace,” Hekman wrote to me in an email. “It also really surprised me when women would advocate to hire a male job candidate when I thought a female candidate was clearly more qualified … It struck me that maybe as a white man I was the only one who could advocate for women/nonwhites without suffering major career/status repercussions, even though doing so was outside my comfort zone.”

So Hekman, along with researchers from the National University of Singapore and the University of Texas, decided to look into these office dynamics. He led a study that surveyed 350 U.S. executives in 26 industries on what happens when women and nonwhite executives advocate for more diversity at their companies.

To start, the researchers pored over the peer reports they collected from the colleagues of those executives. They identified a set of behaviors that they thought suggested a commitment to diversity—understanding and respecting different cultures, valuing working with a diverse group, being comfortable managing people of diverse backgrounds—and then looked for indications of them in the reviews.

Then they looked at performance reviews from the bosses of those executives. They found that white women and nonwhite executives who, in the study’s framework, valued diversity were rated as being less competent and having lower performance. In contrast, white male executives who promoted diversity experienced slightly better ratings: This group was perceived as competent regardless of whether they had made an issue of diversity. In a second study, the researchers asked a group of people to rate hiring decisions. The same dynamic turned up yet again, as participants gave bad ratings to white women and nonwhite managers when they hired white women or people of color, whereas white male managers were not judged harshly for promoting diversity of hiring from their own group.

So why is it that white women and people of color are punished for promoting diversity? Hekman says it has to do with social status. White men are a high-status group, and with that comes the freedom to make bold decisions without fear that they’ll be judged as incompetent. “For the most part, whatever white men do is viewed to be normal, legitimate, and expected,” says Hekman. “So if I as a white man advance diversity, people look at me weird, but they pretty much let me keep on doing it. Sure, I have to endure some teasing, but I don’t lose my social status. I can still talk and voice my opinion on a variety of issues without being stereotyped as incompetent or as someone who is weird or different or illegitimate.”

For anyone who’s not a white man, all of this, for lack of a better word, sucks. It also might explain why some of my friends might prefer white male bosses, because they’re the ones with the most agency. Women and nonwhite executives know there are professional repercussions for promoting other women or people of color, so a (natural) desire for self-preservation can keep their hands tied. “As demographically low-status individuals, women really are damned if they do help other women,” says Hekman.

Stefanie Johnson, one of Hekman’s co-authors on the paper and an assistant professor at the University of Colorado’s business school, recommends that companies should be ensuring that a large number of women and minorities are considered for hires and promotion. She thinks unconscious-bias training might help too. Johnson says that having a diversity policy is good, but concrete top-level actions are important because ultimately, when companies put the onus on their employees to fight for diversity, it might unfairly punish women and people of color. An unconventional policy recommendation, from the National Association of Women and Information Technology, is to put a white man in charge of a company’s diversity efforts, since that person won’t be punished.

But there’s just one problem with that. When Hekman shared his research with his peers, they teased him. “Diversity is threatening to most white guys,” said Hekman. “For example, I shared the HBR article”—he wrote an article about his research in Harvard Business Review—“with my basketball buddies (who are all tall white men) and the only response I got was ‘Burn that bra, bro.’ Basically, they feel there’s a zero-sum competition between races and sexes and so they feel like I am betraying my own tribe. Maybe I am.”

“But,” he went on, “I think it’s the right thing to do, even though it will probably make me have to work harder to maintain my position in the long run. I’m convinced breaking up the old boys’ network is the best thing for society in the long run.”