It's far more valuable to have a place where you can find less popular, harder to find items than to have yet another place full of the popular stuff. That's not to say libraries shouldn't have popular stuff but that they should have a bias towards other things. If you want to read Orson Scott Card, you can find his stuff easily, not so much so for the stuff they're culling.
It's absolutely valuable to have a place to find obscure books... but a community public library isn't that place, and isn't intended to be that place.
The Making of the Atomic Bomb is a classic, award-winning and relevant book. It's exactly the sort of thing a good community library should have, even if it circulates less than Danielle Steel. There is a big difference between what's important and what's popular.
Those Danielle Steel might provide some entertainment and comfort to people (nothing wrong with that). But The Making of the Atomic Bomb could launch a career or a movement, and possibly even -- we can only hope -- save the planet from destruction.
Truly obscure and unimportant books should of course be culled from circulation in a small community library. Their place is in research libraries, etc. But community libraries serve many purposes, the most important of which, in my mind, is to educate and facilitate discovery and personal growth.
Sometimes you have to give people what they don't know they need yet, not just what they think they want right now.
“A library outranks any other one thing a community can do to benefit its people. It is a never failing spring in the desert.” -- Andrew Carnegie
I don't think he was talking about romance novels.
(Interlibrary loan is a significant partial answer here, but as soon as you take ILL into your model you realize that you want to curate the set of all books owned by all libraries collectively. If you locally optimize each library individually then you get too many copies of the common books and too few of the others.)
A public library is there to serve its community. Participating in ILL is part of that mission, so reciprocating is also necessary. But the library has to optimize for its customers first and others second.
Also, used bookstores, and Internet retailers like Amazon, Ebay, etc. Not all books that are "obscure" are necessarily expensive in the "rare, hard to find, valuable" sense (although to be fair, some obviously are).