It is categorically sexist and racist.
Hiring a person based on any criteria other than their qualifications: education, experience, and aptitude, is discriminatory. In cases of preferential hiring of one race or gender over another, it is a violation of federal law.
In recent history, these violations have been overlooked when they go the "right" way: when they favor historically disadvantaged groups, such as nonwhite or female applicants. The intent of such policies is good: to give groups who have been widely discriminated against in the past a leg up, and to help "balance things out." While the goals might be admirable, the execution is poor.
Allowing employers to be racist and sexist in the "right" way furthers the notion that it is acceptable to treat members of different races or genders differently. This is not "reverse" racism or sexism, it is simply racist or sexist. Acting in this way makes no more sense than it would for a person who is against domestic violence against women to promote violence against men to balance things out.
Worst of all, policies which discriminate on the basis of race or gender actually harm the groups which they are designed to help. If an employer is preferentially hiring members of certain groups (races and/or genders), this ensures that those genders do not have to work as hard to get the position. This often means that they are less experienced, less educated, or show less aptitude in their work--which often means that they will be among the least competent of their peers. Likewise, members of the disadvantaged group (typically white men) will have to work harder to achieve their positions, which tends to guarantee that those employees who do make the cut will be among the most driven and dedicated. Lowering the bar for certain groups does not help those groups at all; it hurts them.
People who are hired or promoted should know that they achieved their position because they earned it, not out of some misplaced race- or gender-based pity. Coworkers should know that their peers got their jobs because they were the most qualified, not because HR was trying to meet a race or gender quota.