Exposing children to pornography is not right under any circumstance
Regardless of how you feel about teaching gay pride to high school students, pornography should definitely be out of the question. Would we put copies of Penthouse Forum or Playboy in high school libraries? At least Playboy has something other than pornography, in fact in the past it was known as a source of top-quality short fiction. Even if the one picture mentioned is the only pornographic thing in the book, even that is too much. Obviously the creator of that picture was trying to send a message, ridiculing the Boy Scouts by portraying the sexualization of two of their young members at the hands of two homosexual men. Last time I checked, exposing children to pornography is a crime even if it's done by their school's librarian. This book should have been taken from this school, and indeed from every school, a long time ago, and certainly the only reason it wasn't was because the schools were afraid of being sued by GLAAD or some similar organization.
The school kept the other two books, of which I know nothing and therefore cannot give an opinion, but this one was certainly outside of what could be considered appropriate by anyone other than an ideologue for the gay cause. Even if you think that children should be exposed to the idea of homosexuality as a proper lifestyle, it's obviously just as wrong to expose them to gay porn as it would be to have copies of Playboy to be checked out by students. One of the people who objected to the ruling brought up Catcher in the Rye as an example of a book considered obscene in its time, but as far as I know that book isn't illustrated with pictures of graphic sex or children being exposed to such images.