At least for science books, authors get paid very little or nothing. And no researcher/teacher relies on that for their income.
University researchers/teachers who publish books or articles through them often get paid nothing (zero), or very little. And they do not care, since their goal is get publications in prestigious venues, which helps them in their academic career.
My point is that this stuff should be free, open access, published at low cost through university presses etc. So pirating academic books is basically fine.
That should be up to the author, no? If they decide to not make it open source and take a tiny profit, that's their decision since it's their work.