Doesn’t matter if the school has the book in the library: you have to pay the publisher to access and submit the homework (the homework is not in the book, only online)
I take your point that if the e-books are available via the library, they will charge the library, probably on a pay as you go basis too
I'm only aware of it because my wife went back to school to completely change field (microbiology now, rather than software)