Since when is giving away free food a fireable offense? You're just trying to stop good food from being wasted. Your coworker's reaction makes it sound like you were selling trade secrets. HR might just tell them to calm down.
In many restaurants, giving away leftover food breaks strict policy (seriously, it's in the handbook). That food is still company property, and handing it out can mess with inventory and profits. From a management view, enforcing rules strictly makes business sense.
Actually worked in food service for years. The policy is usually about liability, not just inventory. If someone gets sick from free leftovers, the restaurant could still get sued. That's why most places just throw it out, even though it sucks. It's a legal shield more than a pure profit thing.