For recording and reporting purposes. This got started back in the 70's when affirmative began. Large employers were required to report how many minorities applied, how many women, how many were hired, etc., etc......
The info could also be used to protect them from attacks by the EEOC if a disgruntled job applicant were to claim discrimination if they weren't hired.......
I worked almost 35 years in HR for my company's manufacturing plant in Detroit and in those years literallly thousands of people passed thru our doors, mainly hourly skilled and production workers. So it was crucial that we maintained those records for EEOC compliance.
So it’s made necessary by the overreaching, demanding arm of the federal government. It figures.