I'd need to know more about how peanut allergies work. I mean I assume the kid with the allergy has to actually consume peanut products to be at risk right? It's not like if you have the allergy and some kid throws a peanut at your head, you keel over, is it? Well I don't know, but if that's the case then I see the reason to ban peanuts.
But if it has to be consumed to cause the problems, then I think that all the teachers and staff should be informed about any kid who has a peanut allergy. Especially when the kids are very young the teachers and staff should make accommodations to ensure that the kid isn't given anything with peanuts in it. A 6 or 7 year old can't be expected to restrict their own diet while at school, and the parents can't join them for school lunch every day, so it falls on the school staff to keep an eye on the situation.
This seems the more appropriate policy rather than just banning peanuts.