I have lots of old books that aren’t very good. That I can’t give away. What do I do with them? I have this strange taboo feeling about destroying books, even bad ones!
That is what those book corners are for. In Germany a lot of old public phone cells have been repurposed for that. Just don't overload them and also consider taking some books that interest you. Somehow it regulates and I guess someone also throws away stuff from time to time. I actually would not consider many of those listed in the OP 'libraries' because I rarely see books returning. There are more books exchanges. I liked the idea of bookcrossing.com that gives more value to the books (I never got any ping back though). There are also book resellers (some buy per weight, some let you estimate price by ISBN scanning before sending them)
You could digitize them if you think you (or your family/friends/etc.) would read them: https://www.diybookscanner.org/
(If any are public domain, consider scanning them and uploading to archive.org!)
You can try to find out or estimate how many copies there were. If there are tens of thousands, it may make you feel less bad about tossing them. If people want them, they can find them and it's not necessarily your responsibility. For many books the world's need for them really diminished in relation to what has been mass-printed at one time: popular fiction like airport books, self-help type etc.
Second hand bookstores often buy. You can offer your books to them. Some they won't want, but might accept as a donation along with those that have monetary value to them. In reality, they have similar constraints of space and expected time to when someone will purchase (which could be years for even semi-known books). People have this romantic view about books, but if you want to hold any kind of personal library and don't have a freaking villa, you have to learn to be pragmatic. Even if you don't have a lot of books, get ones that you would read.