Except, you can probably pay an executive's salary AND buy more food and toiletries at wholesale rates with an equivalent cash donation.
https://www.npr.org/2011/11/22/142661882/a-case-for-cash-don...
There is obviously a need for money to buy in bulk the items that are needed. But if you can donate food that otherwise would go to waste and can be used locally as well, it's a win win.
Why is it always better? Cans are all downside compared to cash. They take up space, they deprecate, they may not be what the shelter needs.
Shelters accept food for 2 reasons. 1) Many people see giving food as more "moral" or better than money because they believe the recipient does not deserve anything more than food and getting dented cans of corn is better than nothing. 2) Some people get offended if the shelter will not accept your donation so in interests of keeping donors happy.
TLDR; shelters take ragu sauce and canned creamed corn b/c that's what they can get, but it's about catering to social norms not supporting the needy.