Hypothetically I am not opposed to hiring police officers for schools, if the community wants to pay more taxes to be able to fund a permanent position. I personally believe the effort would probably be a "waste" of money, but there is nothing wrong with trying to make the education and safety of your children the highest priority.
If a community wants to raise its property taxes (which generally are used for schools afaik) to fund it then power to them, but the problem is that schools already don't have enough funds for teachers/education and people won't pay higher taxes/can't afford to unless they are at a suburban wealthy neighborhood. And I also believe the police officer would be ineffective--maybe in some particular case of the various instances of school shootings the police officer would have been effective, but for things like Columbine or even Sandy Springs the shooters would have been perfectly capable to shoot a police officer. Not to mention there is more school shootings than mass shootings.
Volunteers are insane, as it is far far more likely that the volunteer will end up doing a crime against the children or staff of the school (may not be violence, but say sexual harassment or otherwise. There has been sexual abuse cases of security personnel at schools) than solve anything. Police officers are an official state entity though that, I assume, can or already have
1) monthly progress/evaluation reports by their bosses/police chief and peer evaluations by fellow police officers that can catch any officer on a slippery slope in mental health
2) can be made to see a shrink or have access to mental health services on a regular basis to check if their mental state is good besides just the peer/boss evaluations
3) are trained properly and, at least hypothetically, you have to be vetted to be a police officer in the first place to some degree
That all being said, a police officer can also double up as some other functions for the school. I'm 80% sure the crossing guard at one of the elementary schools I went to was a police officer (would have worked for the school in the 30 minutes before opening/after ending, and otherwise have normal police duties). Maybe having a police officer in a school at all times can cut down on drugs that occur at school. Maybe the police officer can be trained to be a sort of guidance counselor as well, and for school kids it certainly can be a good role model.
The problem is that there isn't the funds for it, funds are better spent elsewhere, and it distracts from solutions to the more real problems (mental health system, gun control, etc, as shooters can always go shoot people/children at a mall instead of a school).