Also, the exact needs depend on the neighborhood, but libraries help with a lot of social issues. I spent a fair bit of time helping kids who spoke little English with their homework, digging up resources for dealing with bad landlords and other legal complications, assisting with resumes and unemployment paperwork, etc.
If it was just another Barnes and Noble, it'd be different, but libraries are supposed to be a public resource for finding information. Research librarians were the original search engines, you know. :)
(Academic, medical, etc. libraries serve different roles, of course. I'm just talking about public libraries.)
With the rise of the internet you can get almost any information you need from your computer. I haven't had the need to go and do research in a library for a long time.
No kidding. People hate taxes, though.
Public libraries generally aren't going to be interested in stocking extremely niche-y technical books, anyway. (For that, try academic/research libraries.) Individual collections are stocked to meet the needs of the local patrons, and something that is 1) expensive, 2) only relevant for one person, and 3) likely to be obsolete in three years is not a high priority.