yeah maybe they only do it for the women they interview, as a form of negging pickup technique
If I were turned down for a job that involved writing FreeBSD kernel code and the hiring manager gave me a free book on FreeBSD kernel programming, I'd think they were cool people and try again in 18-24 months.
It's not the act of giving a a rejected candidate a textbook, the insult is that it was a supplemental text book for the very first CS class most undergrads take.
Going back to the interviewers, there are going to be jerks in any organization with more than 20 employees, but the fact that their culture sees this kind of patronizing behavior as "saving the world" and "making a difference" is a red flag for me.