Obama’s reelection was just one month away. A dramatic rescue attempt risked attracting additional media attention to the impending scandal.
The politically pragmatic thing was to let the men die.
It is unlikely but possible that they ORDERED the second attack, the better to suppress any potential witnesses.
The only armed response was from men already inside Libya:
one single word from the president is required to authorise rescuers to enter Libya and he wouldnt do that, since it wouldn’t help him personally.
The hiring of the security was so bad that the guards physically opened the gate for the attackers.