My employer is sponsoring most of the tuition and fees for my master's degree (in aerospace engineering), including required textbooks. Thus, it is unethical and against policy for me to sell those books once I'm done with the corresponding courses. Specifically, the policy is that I cannot "make a profit on" them, but other than that I am free to do with them as I please. I find that having the physical book is helpful when I'm taking the course, but afterwards if I need to reference it a digital copy will suffice. And while having my office/residence full of these high-level materials certainly makes me feel good about myself, it's not practical. Thus, what can I do with these textbooks that will have the biggest, most positive impact on academia?
As an academic librarian, I am frequently asked similar questions. First, please don't just drop them off at the library. Unwanted donations are a significant problem at libraries—it's very difficult to recycle books, so libraries end up having to pay to get rid of books we don't need, on top of the time and effort it takes to deal with a big pile of books on our doorstep.
Do feel free to contact a librarian to see if they would be interested, but be prepared for the answer to be no: textbooks, which change edition quickly and tend to be most useful only to people taking specific classes, are fairly low on the list for most libraries. Some large university libraries do have policies of obtaining a copy of every required textbook, but they will already have a mechanism for purchasing those in a timely manner. If you do go this route, please also be as tentative as possible in your offer: Librarians also tend to dislike telling people "no", so if you push, the librarian is likely to take your books and then quietly dumpster them.
There are some charities that take donations of (some) books. Our library uses Better World Books, which I believe is currently accepting recent textbooks, and you could also look around for programs close to your home.
The most straightforward option might be to pass the books on to another student or students in your program. If you want your donation to have an impact beyond just the student who receives them you could ask them to "pay it forward" by passing along some other books at some future date. (You could also just ask that they pass your books along gratis, but the value of this gift will decrease with every iteration as the books get older and new editions come out.)
If you don't care about keeping any value within academia, you could offer the books for pick-up through something like Craig's List. Whether people want your books for study or a book art program or as kindling for their wood-burning stove, the books will at least have value beyond gathering dust in a box in your closet.
If you want to recycle some or all of your books, you will need to deconstruct them first, or locate a service that specializes in books (these are very hard to find, and may have a charge). If you want to do it yourself, a box cutter or utility knife to cut the pages out works pretty well. The pages can go to any paper recycling service. The cover itself may also be recyclable, but any glue and/or stitching will probably need to go into the trash. You probably shouldn't compost the books, as page coatings and inks can be toxic.
Ask your employer.
You should be able to work out a solution both parties are happy with pretty easily. The obvious one is to sell the books and then give your employer the profits. If they don't care, you can also pocket the profits yourself, perhaps recycle the books or donate them to your university's library.
Give them to the professor. It is often useful to be able to lend the course book to future students who cannot afford the books.
Seeing if the library will take them is also a good choice, as mentioned in this answer, but they may not take them as mentioned here. Overall I think the professor can do the most good with them. He can lend the to the library, or sometimes the school office, for short term loans, give them to students for an entire semester, or decide that the library is the best place and donate them.
Donate to other countries
I'm not sure if this kind of donation is available in other countries, but in my country (Vietnam), there is an organization collects donated English textbooks from the US and ship to libraries in universities in our country. This solves the need of English textbooks in poor and developing countries.
You can visit Vietnam Book Drive if you are interested in this idea.
Disclaimer: I used to work here as a webmaster a couple years ago.
Keep those books that you believe will be valuable as reference material; donate the rest to the university library where you are earning your degree. You know that particular institution uses those particular books. Students less fortunate than you will be able to check them out of the library rather than buying them.
In priority order:
Put them in a bookcase in your office and use them as desk references. Textbooks are valuable resources. You become familiar with them. So good to retain them. Have your assistant order bookcase if needed.
Box them and store them.
Give them to the company/site library.
Give them away to other students, professors, etc.
The reason for the priority is that the company funded your education and you are most familiar with the books. So the most fitting is for you to retain them.
Finally something about this question strikes me as strange. As if you want the $$. Or don't appreciate the company funded education. Or have a pointed aversion to physical texts.
Donate to Textbooks for Change
In addition to other perfectly reasonable options, you can donate to:
This is a Canadian charitable organization ("B corporation" whatever that means) which distributes textbooks. 50% of the books go to university libraries in Africa, 20% are resold cheaply to fund the other operations, and 30% are recycled as paper (if they don't meet criteria for use or have no demand or whatever).
Now, they operate mostly in Canada and Michigan - but they're (also) based on people who volunteer to be "drop points", so that might be flexible.
Caveat: I've never lived in Canada nor the US; and my textbooks were semester-long loans from my alma mater's library - so I never actually had the opportunity to donate to "Textbooks for Change" myself. I just noticed their existence and they seem like a nice initiative.
If there are graduate students or PhD studens working as TAs at the university, they might have use for it when teaching.
I recall teaching a class as a post-doc, and had difficulties finding the book I was supposed to be teaching on (I did of course not want to buy it with my private money). There might even be a small collection of course books available to TAs, so your book might be a good addition there.
Some colleges & universities have "textbook libraries", separate from the main academic library, that will accept donations of textbooks. In later semesters, these libraries then lend the textbooks back out to students for whom buying the textbooks would present a financial hardship.
Such initiatives can be difficult to track down, as they're often run on a volunteer basis. To find whether your institution has such a program, search on Google for "[institution name] textbook library", or make inquiries at the dean of students' office, the academic library, the office of financial aid, and/or the student government association.
Destroy the books.
Another answer referenced using them for "kindling". Finding some way to recycle the paper may also be good. But don't give the books to someone else who will benefit from their text.
My basis for this unhumanitarian-sounding suggestion was this phrase from the question:
"afterwards if I need to reference it a digital copy will suffice."
If you're keeping a digital copy, then you shouldn't be giving away the separate physical copy, because that is essentially resulting in two different copies being used by two different people when the publisher as only paid for one user. This might violate some actual copyright law, usage agreement, etc. But even if a legal loophole causes this to not be technically illegal, such duplication basically violates the spirit of the idea of having the publisher (and, down the line, the author) being paid for each user of the book.
As long as you're (sometimes) using a digital copy, the bundled physical copy should remain unused (shelved, destroyed, whatever).