If you're in San Francisco, you might consider following in the footsteps of the SF Public Library, who just donated 130 thousand books to the Internet Archive.
Like most public libraries, the SFPL hold a book sale every year as part of their funding efforts. They sell off old and unused books from the collection and they sell any and all books, videos, movies, etc that was donated by library patrons.
There's usually stuff left over after the sale, and this year the Internet Archive got the dregs of the sale. This was the second time for the IA, and they ended up with enough books to fill a warehouse. They've catalogued about a third of the mass and found 20 thousand titles that the IA didn't already have. The IA plan to scan and upload any book that they don't already have and then save the book itself in their Physical Archive.
If you would like to clear out your shelves, I suspect that it would be a little awkward to donate the books to the IA. But you can instead donate them to the Salvation Army, a local charity shop, or your local library. Most have yearly sales and thanks to falling tax revenues I'd bet most are desperate for funds.
That's what I did when I cleared off my bookshelves a couple months back. As you can probably guess, I had crossed over to a digital only reading habit years ago. There were books on my shelves that I hadn't touched for years, and in fact the only books that were used regularly were the stacks of paperbacks that accrued in various places (next to the bed, by the toilet, etc).
Most of my books were discarded by my library and sold in the yearly sale, so I didn't think they'd want them again. I ended up giving them all to the various charities that have been bugging me for donations.
But I did keep a handful - just the ones that I regard as collectible as well as the ones not available in digital form. For example, I kept all my copies of Shel Silverstein's books, the boxed set of Calvin & Hobbes comics, and I also kept a bunch of difficult to find books that (barring a pirate deciding to rescue the book) I never expect to see in digital form.
Yes, when someone illegally scans an obscure out of print book I see it as rescuing it, not piracy. I have books held together with rubber bands that if I ever lost I know I would never find another copy.
There's a reason why some say that obscurity is a greater risk than piracy; one house fire would cost me everything, but a digital copy could last potentially forever.