As rules need to be for all, and knives are allowed by all there is then the problem that dangerous people will end up with them.

Then what? The teacher asks: "is that knife for self defence". "Yup". "Give me the knife" "No"... What then? Call the police? Get the knife off them?

Banning all knives is the safest thing to do in schools. There are other ways of sharpening pencils and opening letters that cause a lot less headache.