Gregory Kenney, a married, heterosexual 53-year-old, sued the elite Upper West Side private school in 2013 saying that his lesbian boss canned him because she disapproved of his “traditional family status.”

Manhattan Judge David Cohen disagreed.

“The evidence consistently shows that plaintiff was terminated solely because, despite constant warnings and an ultimate final warning, plaintiff failed to perform his duties,” Cohen wrote in a ruling released Wednesday.

“Plaintiff has not provided any direct evidence or mixed motive evidence of discrimination,” Cohen wrote.

Kenny taught at the W. 91st Street school, which counts Ivanka Trump as an alumni, for 16 years before he was let go in 2012.

His suit said his supervisor favored single, female employees while punishing him for refusing to take on additional coaching responsibilities because he had children at home.