Forty kids enter Hogwarts every year. That’s forty potentially powerful wizards from potentially broken homes, abusive families…orphanages. We all know about Voldemort, and I think that’s reason enough to at least vet potential wizards before arming them, but there’s no vetting at all. Malfoy got in no problem, for example.
The most dangerous are the muggle-borns. Those who know about nuclear weapons, tanks, muggle technology.
It would just take one, one unstable muggle-born to spend a few years in Hogwarts and that would be it. S/he could brew up some Polyjuice potion that would disguise them as an MP, Apparate into Number Ten, use an invisible ropes charm on the Prime Minister, force him to drink a bit of Truth Serum to reveal nuclear codes and…done. The world is aflame.
Wizards could not withstand someone with detailed magic and muggle knowledge. No wizarding community could withstand nuclear bombardment. Even if wizarding structures didn’t sustain a scratch, the surrounding land would be irradiated, the plants killed, the rain poisoned. No food, no infrastructure, they would be exhausted from constant spells to keep the radiation sickness away, completely powerless against a followup attack by foot-soldiers (either magical or muggle).
There is no psyche evaluation at all in Hogwarts. Well, maybe the sorting hat which does literally nothing but put the potentially evil people with other potentially evil people for seven years.
It’s insane. How did anyone think it was a good idea? You could say the same about muggle schools I suppose, but let’s be honest, someone with magic could make a killing in the muggle world. Felix Felicis and the stock market. Time turners. Time and time again we see muggle technology used as a base for forward thinking wizards to make something with: cameras, printing presses, steam engines, motor cycles, glasses, plumbing, radio, record-players, microphones.
What about Avada Kedavra and an M16?
Muggles are a threat to wizards, hence why the wizards live in hiding, but the muggle world augmented with magic would crush the wizarding world.
By an obscene amount of luck, everyone in Hogwarts, even the properly evil ones, even the properly mischievous ones, seem to keep it all a secret.
It would just take one person to, at best, expose the wizarding world. At worst, destroy the entire world in an afternoon.