Because in this particular case, the foreign leader he is admiring is also well-known to have misogynist and racist views. Presumably, the judge also has negative views of women and visible minorities. At least, you'd assume that since he is openly proclaiming admiration for Trump he agrees with Trump's statements and actions.