Yeah thats pretty absurd. The intent of the rule is so pax aren't coming in with a bunch of fast food containers and leaving a mess, along with the smells. It shouldn't be to prevent a family with a bag of snacks for a child from entering... apparently the agent was in a particularly surly mood.