Science is a social activity, carried out by humans who are subject to exactly the same biases and dubious motivations (fame, money, pats on the back from one's peers, going into a field with the intention of proving one's pre-existing prejudices are right) that any other human activity is. I say that as a working research scientist with nearly 20 years of post-doc experience behind me.
So it's not surprising that science occasionally gets co-opted by politics, religion or other ideologies. (Think Lysenkoism in Soviet Russia, for example).
Ultimately, if you're cutting your scientific cloth to fit your ideology, the tension between the resulting "theory" and the real world will become so great that the pseudo-science collapses ("eppur si muove"), but it frequently takes a while.
So it's not surprising - sad, but not surprising - when this sort of idiocy gains traction. Gender ideology is a secular religion, with all the trappings: priesthood, sacred castes, punishment for heresy and for apostates, purity spirals.