Personally, I've been had at least one nonfiction book checked out of the library at all times for the past several months, and it's allowed me to spend a lot of my transportation time (I read while walking, and while taking public transit) reading up on things that aren't online, which I wouldn't have paid retail price for.
Libraries receive a lot of books by donation, so many books in their stock are not vetted in terms of demand or cost, but they'll sometimes clear out books in a section which aren't being borrowed in order to make room for other books.
Related: Heuristics for Evaluating the Soundness of the Academic Mainstream, Admitting to Bias, The Ideological Turing Test