Better World Books is a for-profit organization that, among other activities, will take a library’s discarded books and either donate them to literacy projects worldwide, or sell them via used book retailers such as Amazon Marketplace.
A portion of the funds raised go back to the library that discarded the books, a portion go towards literacy projects, and a portion goes to Better World Books (which is a for-profit organization, after all).
Among the other benefits, they stress that they offer carbon-neutral shipping.
Overall, it sounds like a way to maximize the good your discards can do you, and raise some funds at the same time.
thanks to Belen for the heads-up!