Lets be fair here and acknowledge that the violent Egyptian protesters are in the extreme minority of the general population. So you're still right, the general population of these countries are not violent and want positive change.
What is really disgusting is that the police force did nothing to stop violent protesters from climbing the embassy walls, and Morsi himself showed an extreme lack of leadership by taking too long to respond to the attacks.
And there are just as many crazies in Iran. So yes, I agree with you that it's best to pull out our diplomats out of there before things get worse there.