Gee, if I didn’t know better I would think the cops just harassed him because he was black.
No, it's pretty obvious that Castile resembled the robbery suspect on the video. "Black" only enters into this because the suspect and Castile were both black.
But, Castile didn't know that and didn't realize the officer was afraid he might be dangerous. And the officer probably didn't know Castile was a CCW holder.
In my state, a CHL holder is required to notify the officer, if armed. It also shows up on the license status when an officer runs a warrant check. I don't know the requirement in MN -- perhaps someone can provide that information.
I think there was some miscommunication, that turned out tragically. Rather than trying to assign blame, I'd rather see training on both sides (CCW holders and police officers) to prevent escalation in a similar situation.
That's what is done in my state, and there hasn't been any accidental shootings like this.