Sadly politics is an inherently risky career. It pays well, puts you in a position of public exposure and importance, and it often doesn't come with enough security. Because of this, it is easy for criminals to exploit ambassadors and other low level diplomats to get the attention of governments.
Standing for something guarantees that one will have enemies, one will have obstacles, and one will have opposition. One always takes a risk when representing an ideal or, in this case, a certain country that represents certain ideals (which all countries do). The amount of contrasting ideals are so prevalent in foreign affairs today, and that in combination with technology that allows us to escalate these idealistic conflicts to a violent resolution/protest often makes a recipe for disaster and danger.
Ambassador Stevens is the best example of it being dangerous to be an ambassador. He asked for more security many times. When he finally was attacked, Obama sat around thinking about what to do, rather than to defend him. The ambassador from Russia that was shot while he was in Turkey is another example of danger for ambassadors.
As recent events have shown, individuals sometimes commit terrorist acts towards ambassadors of a certain country because the terrorists hate that particular country; the ambassador ends up taking the brunt of the violence when overseas. For example, a Russian ambassador was assassinated by a Turkish gunman who sympathized with Aleppo, due to Russia's recent attacks on Aleppo and Syria.