The internet is a commercial, mass media space, in large parts an entropy machine, where you're unlike in the library backroom are always under surveillance, where it's not you actively engaging with books but the internet engaging with you. A library is a repository of knowledge (which is not the same as information or "data") the internet is a dark forest where some pretty eldritch entities are always on the lookout for someone to pounce on.
Kids can be free in the library because, as to the title of the thread, there's always a librarian. There's no heroin needles on the tables. You buy the freedom of the library by it being an ordered and protected space.