For good reason too.
No, "some kids are allergic, therefore you cannot eat it yourself" is really not good reasoning. Nut allergies are usually diagnosed very early, so everyone who has it should be aware of that.
Yes, aware of it, but can you really stop kids from touching peanut butter by accident? Do you want to be the reason that some other kid dies because you gave your kid a PB&J for lunch?
Some people are allergic just to the smell of it. So schools do the reasonable thing and ban it from school. And I guess if you're gonna ban peanuts, why not nuts too. Some people have other nut allergies.
Frankly, I think the real problem is kids bringing those sandwiches and whatnot to school. So just in case, we should ban all kids.