If the point of the punnet square question was just to fill it out properly, then he could have made any kind of obviously absurd but harmless gene examples if he wanted to just "have fun" with that part without issue. Instead he went racist absurd, integrated into what I'm reading as a rant against the diverse student body of his school whom he perceives basically as all "acting Black" (however he stereotypes that, including his example of "pimp walking") instead of "being themselves."
I mean, I've seen teachers mess around on tests, worksheets, etc. they write up and be silly In a harmless way. This dude decided to take a different kinda route 😬