It could very possibly be legitimate. Not only does the federal government collect this info for construction projects (which is the industry I'm in), but every year I fill out a form that lists current, terminated, and new employees (in addition to applicants) by race, gender and job title.
I would think that your HR department would be the one to handle this form, however, it is possible that this payroll company took over that task as part of their contract.
If you are uncomfortable with the request, call and ask.
The form I fill out yearly is the Employer Information Report EEO-1 from the EEOC that is just current employees. Last year I got two new ones. One from our state employment commision and one from the Department of Labor Office of Federal Contract Compliance Programs Equal Opportunity Survey. I think they may have been random because I haven't seen them this year, but I did verify that each was a legitimate request before I completed them.
Hope that helps.
Michelle
