It isn’t, as long as the person is the best qualified. But trying to make the court “look like America” only for the sake of appearance is still affirmative action by race.
What makes someone the best qualified candidate?