Most people who write non-fiction books do it because they want to contribute to human knowledge and be recognized as an expert in a particular field, not because they think that writing a differential geometry textbook is their path to riches. With the internet, more and more text books are made freely available by their authors - the reason this didn’t happen in the past is because there was no other way to pass knowledge around than teaming up with a publisher who is able to put your knowledge on to dead trees. It’s fair game to put older books on the internet, so that the whole world can benefit, not just rich people in rich countries.