You actually can't assume that anyone is always going to be the "good guy", or that anyone else will always be a "bad guy".
And if you could program a smart gun to have a sense of morality, capable of judging between appropriate and inappropriate uses of lethal force, you no longer need a human to carry it around, do you?
If the bad guys can't have guns, good guys can't have them either, because sometimes they are exactly the same people in different circumstances. That's the big hole in good guy vs. bad guy reasoning.
Cops without guns: https://youtu.be/cX5CPx4RKWw
Cop with gun: https://youtu.be/RdoeBXt06Bc
Only one British police officer was killed in the line of duty last year - PC David Phillips, who was run over during a pursuit. In the same year, eight American officers were killed by vehicular assault, 36 were fatally shot, three died after being assaulted and two died of accidental gunshot wounds. In 2014, no British police officer was killed on duty.
Even accounting for the difference in population and the prevalence of firearms, there is a substantial disparity. Britain does have armed criminals, but our police are not routinely armed.
There were riots across Britain in 2011, precipitated in large part by the fatal shooting by police of Mark Duggan. Only one other person was shot by the police in 2011. In the same year, the FBI estimated that 400 Americans were killed by police officers, but no official count exists.
There is considerable interest amongst US police forces in learning from the British approach, as shown in this documentary:
You are not selling me.