The said purpose of-course is to make sure that the candidate is "committed to diversity". We can argue all day on whether a statement is in any way good measure of it. It really isn't. I have helped people write such statements and we have always written it with cynicism and great contempt for the people who might actually read it.
But the "real reason" which such concept found a great foothold in modern American universities is that it kind of acts as top kill to get rid of potential people who might actually ask questions critical of various ideological positions that the university's internal bodies might have. You either want a radical zealot or at least someone who is willing to play along for his own career-maxing goals. What you don't want is someone who can call the emperor naked. Diversity statements are excellent way to achieve this as I have seen people write one line diversity statements such as 'I don't have one as I do not think diversity is important'. Such person IMO is more intellectually honest and would be a good addition to faculty position but will not be hired.
You are right that there is tons of resentment around the DEI BS that people have to go through. Tech companies have esoteric training problems with terms like "allyship" and "bystander effect" and all that which basically smells rotten to lot of engineers but they cynically complete those trainings any ways.