I'm going to go against the grain here.
Libraries were an excellent community resource when they were built.
I dont think they have the same value in modren society.
Books now cost a vastly smaller % of average incomes than in the past. We live in a world of amazon, ebay, freecycle and charity (book)shops on every High Street. You can now buy discounted books in the same shop as your bread. The world has moved forward, libraries need to adapt or flounder.
Access to education is much wider now than in the 18th century. Schools, colleges and Universities now educate people, who would previously only had access to knowledge through libraries.
Modern libraries are used for free internet access but surely the move to make sure all housholds have their own braodband is more useful than maintaining a resource which is only suitable for some. When both my DCs were babies, I had no internet so went to the library to log on. I went over 20 times but it was not a good experience. If the baby made a noise (as they are likely to do) I would get evil looks from other users. There was no toilet for changing. No designated breastfeeding space. I wasn't even allowed to use a bottle as they had a 'no food or drink' rule! After reading for a bit I would have liked to be able to eat or drink myself but I'd have to go out in the cold for that. I tried a good few different ones and found them all hostile environments.
I also think, that when you look at the range of books/CDs/DVDs available, you have to question the value to society of providing titles which have little educational value and are just pulp fiction/popular entertainment. There is a very small proportion of high-quality non-fiction.
As for libraries being useful for doing homework, I did this as a child, but this was before the age of after-school clubs. Surely it would be better for schools to stay open later and provide better libraries and study space themselves? do we really need 2 seperate buildings/institutions?
I think that in the long-term libraries would work well if they amalgamated with other community resources such as schools/community centres/sure start centres etc, providing community projects (eg delivering books to deprived families/ESOL classes etc) that target those most in need rather than the middle classes who see them as a taken for granted freebie paid for by everyone else.