I covered a lot of violent demonstrations as a reporter during the Civil Rights and anti-war eras of the 60s and 70s, and I think too much was expected of the cops at the Capitol, and if anyone should be blamed for their failure it's probably Pelosi and McConnell. They are ultimately in charge of the place, and that includes providing money for security. It was obvious to me that there were no where near enough cops to control that mob. Why not? Because the Capitol cops are barely cops -- they're more like security guards who check people through doors and the magnetometers that make sure people don't bring guns into the place. They're fundamentally like bank guards. There were other much tougher cops available -- the metro cops, the Virginia and Maryland cops available through mutual aid agreements, and also the FBI and US Marshal SWAT teams, who nobody in their right mind would fuck with. (The Army National Guard's ground troops are basically good for handing out sandwiches.)
The basic failure was one of intelligence. The Capitol has not been taken over and ransacked since 1814, and I don't think anyone really expected *this* to happen -- a loud and noisy demonstration, yes, but two miles away from the Capitol (at the White House.) We knew that Trump is goofier than an outhouse mouse, but even though I sincerely believe he is nuts, I never imagined that he'd give a rabble-rousing speech to a mob and then send them hurtling toward the Capitol.
So, that's what I think happened. We have a Capitol basically defended by security guards (and enough of them to easily handle daily problems from crazies) but not nearly enough to handle a crazed mob of thousands of people. Yes, people knew that Trump had summoned up a big demonstration, but anyone who says the cops should have expected *this* really doesn't know how these things work, when people are concerned with things like overtime, work schedules, etc. When I saw that crowd running toward the Capitol and that thin line of cops on the steps, I thought, "Oh, shit, here we go." [Edit. I've actually thought that several times in my life, including the time an elderly bigot at a Civil Rights demonstration in Cairo, Illinois, tried to strangle me with my camera strap.]
As an ex-reporter, I would have given my left nut to have been there. I haven't been in a really good riot since the 1972 Republican National Convention in Miami Beach.