Different communities will have different justifications. I spend a lot of time in libraries (3-5 days a week) so I see a lot of the different ways people use it.
Some areas do not have widespread high speed internet. You cannot access the internet on dial-up any more. All the pages are packed with video that takes hours to load.
Not everyone has a device to download content. Our library lends nooks pre-loaded with books that are put on for the patron. E-books are restricted by the publishers to a 14-day reading period with no renewal. Books can still be taken out for 4 weeks and then renewed twice.
Libraries are unique in their research capabilities. Librarians can still find things that many cannot. The ability to be a participant in the demoncracy has no stronger defender, nor tireless searcher. Librarians will get that info you want, and make you a paper copy for a nickel. This one is huge, IMHO, as there is no other place in the community that offers help with research or connections.
Libraries still offer a learning place for children to be on their off hours. Ours does not have a playground, but it has books and chairs. These are filled with children every day.
The adult section has a steady stream of elderly people who come in to read a newspaper or magazine
The computer section is filled with waiting lists every day, and there is a steady stream to the help-desk on how to navigate.
The Young Adult section has teens in it every day, filling every available chair plus the floor.
Tutoring happens there, with resources.
Writing clubs happen there.
The summer school lunch replacement happens at ours, and the kids get a book while there.
many of those above are the kind of thing that lifts up the citizenship of those with least fortune, which, IMHO, benefits the whole society by creating productivity, peace, contentment and safety.
...just some of the justifications that exist.