The primary difference is that in a library or bookshop there are competing ideas right there in the same room. A curious mind will develop critical thinking skills. There are also curators who care about something other than making money - they're playing a long game, so will apply quality/safety filters.
This is opposite to the algorithms, which in the name of monetization needs to pull you down into a rabbit hole, an echo chamber void of contradiction, a spell of indoctrination and affirmation of your own Worldview.
Fiction, in particular, is a useful abstraction to grow emotional intelligence in hand with critical thinking. It allows - no, it demands - you develop a sense of empathy and live a life in someone else's shoes. You can then bring that experience back to your own idea of self and your place in the World.
There's a lot of money in putting ads next to content teaching a kid who feels sad that they should kill themselves. I have absolutely no doubt that the World would be a better place if people were inclined to read books instead of hang out on social media, even if those books did contain dangerous ideologies.
So, maybe it's time to revise your stance.