I see the potential demand coming from everywhere and anywhere as being richer and more vibrant than demand coming only from those willing to pay for the materials and services. Backstock does not include bestsellers or hot titles. The potential richness of characters one can meet should also be greater in a library than in a bookstore. At a bookstore, one usually meets only those who have enough money to pay. A library doesn't use a selection criteria based on the profitability of the selection.
Libraries select based on a more broad criteria including utility to the public.
I distinguish between for-profit stores, and those run by folks who don't have to make a profit. There are still bookstores who can survive by breaking even, or can stand a slight operating loss because the owner has funds from elsewhere to cover living expenses. A really good business will figure out how to be profitable in all neighborhoods. What is sad about the issue of bookstores vs. libraries is that the bookstores can pick their locations in a way that libraries usually cannot. Fact is, lots of libraries in the suburbs must look like a Borders because that's the expected comfort level of their user patrons.