Schools who ban nuts are acting in everyones interest. Nut allergy can kill. Not eating nuts can't kill. Once a child opens a bag they can't be expected to police which other child has one too.
Presumably peanut butter is allowed on the basis that a child is more likely to share a bag of nuts than a sandwich?