I really like what Nautigal is saying. I think I have a different point of view, though, as I HATE confrontation.
I think a lot depends on both the question and the teacher. DS had a lot of frustration with his teacher last year because frequently his answers were right, but were not what the teacher was looking for. I used it as an opportunity to explain to DS that when he's doing school work, he should generally choose the most appropriate answer and not complicate things. For example, if you're in 2nd grade and they show a picture of a tarantula in Language Arts, they're probably looking for the word, "spider" and not the word, "arachnid."
Personally, I would have an issue with the teacher's lack of fairness in the OP's post, and would likely explain that to my DS if he were in that situation, and encourage him to talk with the teacher about it once. If the teacher balked, I would probably explain to DS that it sounds like neither the student nor the teacher would benefit from the confrontation required to correct the error. It is a valuable skill to understand your audience (or opponent), and to know when to push and when to walk away. Another lesson he could learn is that people in teaching/authority positions are not always right.