apparently because of the religious nature of the student's presentation, the student's expression of opposition for same-sex marriage in the presentation, or both. On top of that, he apparently called the student a "fascist bastard" in front of the class for having supported the anti-same-sex-marriage Prop. 8, and refused to allow the student to finish the presentation. Lovely.
The student, helped by the Alliance Defense Fund, is suing (Lopez v. Candaele). The Complaint I linked to includes supporting documents. In particular, the evaluation sheet on p. 31 reflects that the teacher indeed didn't give a grade, but instead said "Ask God what your grade is." It seems to me pretty clear that refusal to give a grade because the teacher disapproves of the religiosity of the student's presentation, or of the student's opposition to same-sex marriage, is indeed a First Amendment violation.
Professors doubtless have a vast degree of flexibility in grading students, even in viewpoint-based ways. For instance, if a law student is told to construct the best possible argument in support of position X (as I often require on my exams), he may be graded down for instead constructing an argument opposing position X. Likewise, if a student, in response to a question about how old the Earth likely is, answers "6000 years," he can be graded down even though a student who answered "4.5 billion years" would have gotten full credit. A judgment about how old the Earth is an expression of a viewpoint based on the best available evidence, so the professor's grading would indeed favor one viewpoint over another -- but entirely permissibly so.
Nonetheless, this flexibility can't be unlimited, I think: When a professor refuses to give a grade, or (to take a hypothetical) even if the professor gives a low grade but for a reason that pretty clearly falls outside the academic subject matter of the class (for instance, because a student in a speech class expressed political viewpoints that the professor disapproved of), that violates the First Amendment.
The evaluation sheet also shows that the teacher wrote "proselytizing is inappropriate in public school." If, as seems likely, this represents the teacher's view that it is somehow an Establishment Clause violation for a student to convey religious views in his in-class presentation, that is not accurate. (If the teacher had set up an assignment that required secular arguments rather than religious arguments, I think that would have been within his authority, since I don't think Rosenberger applies to class presentations. But the teacher's reference to public school suggests that he's making a claim about the constitutional rules that apply to public institutions, and not to general professional norms that would apply to all colleges, or specific requirements for his own class.)
The complaint also seeks to invalidate L.A. City College's campus speech code, which the professor also referred to in a follow-up to the incident (see p. 170); I think the plaintiff should prevail on that.
Finally, note that one of the College's responses (pp. 37-38) states that the College is indeed acknowledging that the teacher's behavior was improper, that the teacher would be disciplined in some unspecified way, and that Lopez wouldn't ultimately be penalized on his final grade. At the same time, though, the College's response notes that several students were offended by Lopez's statements, and says:
Where do we go from here? Regardless of the other students' reactions to Mr. Lopez' speech, Mr. Matteson will still be disciplined. First amendment rights will not be violated as is evidenced by the fact that even though many of the students were offended by Mr. Lopez' speech, no action will be taken against any of them for expressing their opinions.
No actions will be taken against any of the students for expressing their opinions critical of Lopez -- what a blow for the freedom of speech! (Even if the "any of them" is meant to include Lopez as well as the other students, surely the reference to "any of them" misses the point, no?)