A federal judge sided with Temple University yesterday and dismissed a former student's lawsuit alleging that he was denied a master's degree because of his political views.

Former graduate student Christian DeJohn, 37, of Wyncote, sued the university and two of its professors, saying he was denied his degree because of his views on the Iraq war. Lawyers for the university said DeJohn was a marginal learner who turned in a bad thesis.

Before a jury could take up the case, U.S. District Judge Stewart Dalzell ruled in favor of the university on DeJohn's allegations that his constitutional free-speech and equal-protection rights had been violated. The court earlier dismissed counts alleging violation of civil rights and other protections.

"In short, his academic performance just wasn't good enough," Temple lawyer Joe H. Tucker Jr. said. "It had nothing to do with his First Amendment rights and had everything to do with Temple professors' academic freedom to grade a student's poorly written, poorly constructed . . . thesis."

The judge earlier upheld DeJohn's objections to former provisions of the university's sexual harassment policy. Yesterday, he barred Temple from reimplementing the policy but awarded DeJohn only $1 in damages. University lawyers have appealed but said the policy had already been changed.

DeJohn entered the master's program in January 2002 but took a leave of absence after the first semester to serve in Bosnia with the Pennsylvania Army National Guard.

While away, he said, he received antiwar e-mail from a mass list-serve at Temple that included professors. DeJohn asked to stop receiving the e-mail, and upon his return said he lost the support of the history department faculty and was subjected to personal attacks, his lawyer said.

Lawyer David A. French of the Alliance Defense Fund, a Christian legal group based in Scottsdale, Ariz., said his client was disappointed with yesterday's decision.

"The jury had heard a lot of evidence and Christian was eager to see what the jury thought," he said.

French said, however, that the ruling on the harassment code guaranteed greater academic freedom for all Temple students. DeJohn's suit, citing provisions barring "generalized sexist remarks" or conduct that "implies a discriminatory hostility," said the code was vague and overly broad.

"Harassment is not something that hurts your feelings," French said. "What is unlawful is conduct that is so severe and pervasive that it disrupts my ability to get an education."