Again, put yourself in the agent's shoes. Your job is to secure whatever chamber of Congress to which you've been assigned. Life is going on as normal when suddenly you hear that a crowd has entered the building. I wasn't there and can't say definitively what our agent heard, but I would bet money they heard terms like, "'mob', 'violent', 'capitol breached', etc". Those terms convey the impression of an angry mob that has overwhelmed police outside the doors. Therefore it's not an unsafe assumption that the mob may indeed try to harm your charges.
So, in such an intense and rapidly-changing situation, the agent would understandably be stressed and keyed up. Naturally then, when the glass was broken and one of the crowd began climbing the door, looking for a way in, the choice (as our agent saw it) was likely either take her out NOW or risk a human wave being emboldened, breaking through the door, and being beyond the ability of the agents in the room to contain...it is not generally a good idea to let an angry mob [real or perceived in the moment by the agent] have access to whatever made them angry, so the agent opened fire and killed Ms. Babbit so as to dissuade more in the crowd from trying to bust in.
I see no reason why anything there, from an operational and legal perspective at least, was flawed. Ms. Babbit was at the lead of a mob who had broken past security and was roaming nigh-unchecked throughout the Capitol building. I truly hate that she died, but she put herself in a REALLY stupid situation, one far more so than any of the other rioters. The, "play stupid games, win stupid prizes" quote is, callously albeit, fitting.