I don't buy the whole "it's not illegal, just buy it from a bookstore yourself if it's banned from the library" argument after what happened with Steam and payment processors. What's next? "Just buy these books from a physical bookstore (not online) that is cash only because payment processors have booted the store off their platforms. Also, only old/used editions are available because publishers are afraid to print new runs. But it's not illegal so stop crying"
The latter often leverages the former to work around having to legislate things that are unpopular or unconstitutional. A great example is government agencies buying data from data brokers or the Twitter files where the government leaned on Twitter to downrank "wrong" ideas. With the proliferation of powerful near-monopolies - especially in tech - "the market" has little way to work around these kinds of problems, especially in the short term.
I guess my point is that both are dangerous to freedom, and ideally the government would do something to curtail corporate censorship instead of encouraging it. That's the whole idea of a "common carrier"[1].
I am not equating the two, I am pointing out the flaw in the logic of viewing each in isolation and rationalizing. Excusing state-level book bans in libraries with "you can just buy it yourself with your money instead" clearly ignores what has been happening in the private sector.