I think the fact that criminals carry guns (at least in this country) kinda automatically negates any sort of philosophical discussion we could have as to whether or not police officers should have them.
I'm sure there are some young officers that probably should have them and some young officers that probably shouldn't. Since people are permitted to choose (or not choose) their own profession, I imagine that most police forces are required to select their candidates from those that apply. Sure, some screening can (and does) take place at this first step, as does additional screen occur if the cadets are incapable of successfully completing the training.
No doubt these one-off incidents are a great cause for concern and deserve our attention. However, I think that for the most part, police officers are highly-trained professionals that take their job (i.e. keeping us safe from bad guys) pretty seriously. I think we do them a huge disservice when we make suggestions such as "we're going to take away your guns so that you can get stabbed by bad guy with a knife or shot by a bad guy with a gun". These aren't automatons. They're men and women with husbands, wives and families that worry about them every day (or night) when they leave for work. Their job is hard enough as it is and making it harder by taking away the means to defend themselves seems silly in the extreme (to me anyway).
At the end of the day, we could make the entry requirement stricter. We can also make the training more difficult. However, keep in mind that law enforcement does not pay well in a lot of cases and is inherently high risk. At some point the risk/entry-requirement vs. reward scenario will dictate that recruitment efforts will drop off which equals fewer cops on the street. I can't imagine that anyone wants that.
To summarize my rather lengthy answer: there is no quick fix for this problem.
Before I step off my soapbox, I think that I should disclose that my father was a career police officer and I that I briefly majored in Administration of Justice with the intent to follow in his footsteps. Hopefully that will allow you to clearly identify any bias which may be present in my opinions as I have expressed them. Thanks for reading.