Two high-profile legal cases in which white men have accused employers of discrimination or retaliation have put a spotlight on U.S. companies’ efforts to make career advancement more accessible to women and people of color.

A recruiter is accusing YouTube of retaliating against him after he complained that the video site discriminated against white and Asian male applicants in favor of hiring other people of color and women. The case comes on the heels of a lawsuit against Google, in which James Damore has accused the company...