Censors may say that they object to books that reference gender and sexuality, but what they generally mean is that they object to books that reference genders other than “cis girl/woman” and “cis boy/man” and sexualities other than “heterosexual.” A book that uses any gendered pronoun (such as “she” or “his”) references gender, and a book about a cis girl and a cis boy falling in love references sexuality.
Nonfiction books about all genders and sexualities and fiction books that include characters from across the spectrums of gender and sexuality reflect the existence and lived realities of people all over the world. Libraries have a duty to provide materials on a wide variety of topics from a wide variety of perspectives; when librarians include materials about all genders and sexualities in their collections, they are fulfilling their professional obligation to foster intellectual freedom.