Having deep respect for police officers I hate admitting when they take a bone-headed move that took an innocent person's life. It may be hitting someone during a high speed chase, or pulling the trigger when it never should have been pulled. This is one of those times. Though the cell phone video does not paint the whole picture of what happened, and how the conversation went between him and the officer.
Unless the officer truly intended on killing Castile, which I doubt, I suspect the dialog went something like this and that carelessness on both could have been a contributing factor.
Officer _ "Let me see your License and Registration please."
Castile - "man this is Bull S%$#, I didn't do anything."
Castile - (reaching for wallet) "I have a gun and" ..........not being able to finish the rest of the sentence which would have been
"I have a permit to carry it".As a CCW holder I have always been taught never to use the word "gun" to an officer pulling you over. Hand him your CCW with your drivers license and let him ask you the question if you are carrying. The conversation above is purely hypothetical, but if the actions by the officer and castile would have been more like this video that I have seen dozens of times since seeing it first in a handgun training class I took my wife to, things would have turned out a whole lot different.
http://www.youtube.com/watch?v=dT-nePQuT-s