Is this legal? - Layoff list

Hi! My company recently did layoffs--a little over a quarter of the total employee count. They attached a list of all the positions in the company to some of the documentation: the list had employee titles, then their ages, then whether they were let go or not. No actual names, but the identity was pretty discernible from the title and whether they were kept or let go.

The company has a legal dept so I think it's legal? But I told only 2 people about this and the first thing out of both their mouths was "is that legal???" so I thought I'd ask. TIA