Actually, you bring up a good point.
ATFP requirements at such facilities require crash gates and standoff distances. These aren’t simple chain link gates.
Early reports claimed the initial assault involved an RPG fired at the main gate to breach the gate, then a guard returned fire on attackers, was neutralized, then about 20 armed attackers walked into the compound.
Perhaps the RPG targeted the armed response and others placed explosives to level the gate. Standard tactics in a dedicated coordinated preplanned attack, obstacles such as gates only delay an enemy. They are always kept under observation, with the area in front of them generally used for preplanned fires, in the event they are assaulted.
They should have delayed an unopposed attacker about 10 minutes and a well defended position probably 15-30minutes.
In company sized attacks (say 120-150 men), they are generally only supported with about 15 minutes of ammunition, so a defensive position usually has the advantage, possibly forcing the attackers to expend all their ammo before reaching their objective.
If the main gate is too fortified, attacks usually hit a perimeter wall, not the avenue of likely approach.
Why did they attack the gate? Perhaps their intel was gleaned from those who had access via the gate and at night, it made mapping the compound easier to coordinate.
Another question is where did the attackers go between attacks? How were they resupplied or were they? Other news reports indicate some 50 pickups arrived around the area throughout the night, exclusive of the rescue reaction force from Tripoli and the militia to support them.
Normally, all of these points would be considered within the chain of command, but when the AFRICOMinC was relieved, because he was performing his duty, then covered up, it’s quite likely that nobody is performing the analysis.