That's the opening paragraph of an article in the latest issue of the Journal of Economic Perspectives by Candice Prendergast. His answer to the question was to create a market to allocate the food while attempting to feed the most people and have some equity across food banks. He shows that there were myriad details and market design issues that had to be overcome, but the ultimate outcome appears to be wildly successful. He writes:
For those wanting to learn more, a couple years ago, Prendergast was on the Econ Talk podcast with Russ Roberts discussing these markets.