Hanlon's Razor tells us that we should never rationalize something as intentionally evil when it can equally easily be explained by stupidity or incompetence. Tie that into Occam's Razor: when presented with two answers to a question, the answer that requires the fewest departures from the norm is usually the correct one.
Consider the situation at hand: the teacher has singled out one student, accused him of racism, and then assigned him, and only him, a paper in which he must indirectly apologize for being racist.
Now, consider the two conflicting explanations: yours, which calls for the teacher to A) be faking outrage B) be knowingly making a false accusation against a student C) be doing A and B while also assigning a single student additional work without due cause, and D) believes A-C to be worth the valuable lesson that she has orchestrated for the student to learn.
Or, alternatively, mine, which only requires that the teacher is irrational and bad at her job.
Never assume brilliance when stupidity is far, far more likely, mate.