My point is simple. A person should be hired based on their skills/qualifications and potential ability to do the role (based on the experience/interview) and that should be the main and overriding criteria.
Of course, you can have hypothetical scenarios e.g. you have two candidates who are equally qualified and practically match neck to neck and you can only hire one and you have a lack of diversity in your company, sure, you can hire the person who brings more diversity.
However, if you have, say, white male person who is more qualified than, say a non-white female person, and those are your top two picks, then you should choose the former because it is about being most qualified for the role. If the non-white female is most qualified, than she should be chosen. I'm simply advocating meritocracy.
You mentioned that "The diversity program came about because they are actually struggling to find enough qualified candidates" and "he company was majority white and male, and they didn't have enough people, so they decided to tap into the vast universe of people who aren't white or male". I don't understand the first part - were they excluding non-white/non-male people from applying initially? Isn't that unlawful? Why didn't the "vast universe of people who aren't white or male" didn't apply initially and had to be brought in via diversity program?