In addition to protecting food from its microbial surroundings, packaging significantly prolongs shelf life, which in turn improves the chances of the food actually being eaten.
...if you take the packaging away and focus on the naked food itself, you have to realize that the food will be rotting a lot sooner than if it weren’t packaged and, as a result, will be heading to the same place as the packaging: the landfill. Decaying food emits methane, a greenhouse gas that’s more than 20 times more potent than carbon dioxide. Packaging — unless it’s biodegradable — does not. If the landfill is connected to a methane digester, which in all likelihood it isn’t, you can turn the methane into energy. Otherwise, it makes more sense to send the wrapping (rather than the food) into the environmentally incorrect grave.
...[O]ur behavior in the kitchen far outweighs the environmental impact of whatever packaging happens to surround the product. Consumers toss out vastly more pounds of food than we do packaging—about six times as much. One study estimates that U.S. consumers throw out about half the food they buy.