YouTube last year stopped hiring white and Asian males for technical positions because they didn’t help the world’s largest video site achieve its goals for improving diversity, according to a civil lawsuit filed by a former employee.

The lawsuit, filed by Arne Wilberg, a white male who worked at Google for nine years, including four years as a recruiter at YouTube, alleges the division of Alphabet Inc.’s Google set quotas for hiring minorities. Last spring, YouTube recruiters were allegedly instructed to cancel interviews...