My first instinct is that the Google interviewers were just so full of themselves that they think they're doing you a favor and would do it to anybody, regardless of gender.
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.