This could've been prevented if the president (1) didn't incite this and (2) didn't deny national guard to step-in.
So what's left is the capitol police facing a mob invited by the president, without backup. And they stated they had two choices, barricade the capitol and prevent entry, or evacuate the people inside.
It could've gotten ugly if the people in the capitol got overrun, e.g. Pelosi facing people that think they're sent by Q to fight off a satanic coup by Pelosi, but they got evacuated to safety. Apparently capitol police chose to evacuate rather than to barricade, in hindsight that's clearly the least risky option to human health. If they break through with nobody inside, that's not as bad if they break through anyway with people inside. A bunch of idiots roaming the capitol building isn't a threat per se, shameful and sad yes, but not one that should've been met with violent force from a small number of capitol police at the expense of (and risk of not) evacuating the people inside.