I was in Cairo during the Egyptian revolution, and while some embassy workers there were required to evacuate, a sizable crew remained on the grounds. As an ex-pat, it was a very scary three weeks but there was no immediate threat to foreigners as it was an internal conflict and as long as we didn't go asking for trouble, we were safe.
However that was before Benghazi, and Libya and Yemen are much more tribal than Egypt. Also, Egypt is a major ally of the US and they were very invested in protecting American expats, in Yemen not so much. I'm pretty sure the US will err on the side of a premature evacuation if they have any sense that American lives are in danger, no one wants a repeat of Benghazi. Also, Benghazi was a consulate, not an embassy, so procedures may have differed.
The hostility in the Middle East stems from an incredibly long list of exploitations, interference, resource extracting, and human rights horrors that the USA and Europe have perpetrated on the civilians in the region for decades now. It's no surprise if you actually do your research.