Either you have been bamboozled by polarizing lies or you are making up those lies yourself.
It is fairly trivial to leave books in the library without forcing children to read them or recommending that they should. I hope that all school libraries have copies of Rudin, Marx and Kripke too—and that’s it.
Honestly, I kind of doubt that would ever happen. Marx's most famous books might be kept only because of their extreme fame, but you'll rarely if ever see mathematicians or analytic philosophers like you listed. They'll rarely if ever be checked out, and will be weeded. A school library isn't an university library.
They also have the The Communist Manifesto, which seems more like the kind of thing a precocious or edgy teen might actually read (at least in the pre-smartphone era).
Inform yourself.
Putting the book Gender Queer in the children’s section is extreme. Have you seen that book? Looked at the pictures? You wouldn’t be able to show that book on broadcast TV and there are librarians that insist kids should read it. That seems pretty extreme to me. If it were a book depicting graphic heterosexual sex acts, there wouldn’t be any controversy over banning it.
There are some schools that have Gender Queer as part of the curriculum.
The idea of literal pornographic book availability to minors shouldn’t be controversial.
It’s a subset of librarians that have become extreme. Activists demanding children be exposed to graphic sexual content in the name of “inclusiveness” are the extremists. Kids can learn about LGBT experiences without having to also be exposed to graphic sex depictions. If that’s an extreme position, then I suppose I am an extremist by that definition.