But that's not the justification you gave. Instead you said it's evidence for likely future wrongdoing. By bringing up race I am in no way suggesting you are racially biased. Indeed, it would have been pointless to bring it up if I thought you were. The point was to give an analogous example of punishment for anticipated future wrongdoing that I assumed you would accept as wrong. If it's wrong in one case it's wrong in the other.
Your intuition about the student's abilities is probably correct, but intuition is no basis for justice. People should not be punished before they've done anything wrong. This is a fundamental ethical concept. The student deserves a fair trial by exam question, not instructor vigilantism.