In the previous episode, and took a hit from Shigaraki's Rivet Stab Quirk, a favorite of big villain All for One, which should've been his first clue that something wasn't right. However, seeing both Endeavor and Bakugo fall sent the normally cool and calculating Midoriya into a rage, violently lashing out at the perpetrator. But this reaction was exactly what Shigaraki/All for One hoped for, as it allowed them to get close enough to try to steal Midoriya's Quirk away.
In order to take the average person's Quirk, all that All for One needs to do is touch them, and it is rapidly absorbed into his body, causing any physical effects on the original owner's body to fade away. For Deku, currently , losing his Quirk would've meant plummeting to the ground right behind his allies from what was surely a dangerous height. Had this plan succeeded, not only would All for One have obtained One for All, removing the heroes' greatest asset in stopping him, but Deku would likely be dead, and the other heroes in the area would be All for One's next targets, taking out . The only reason this didn't happen is that One for All had some unexpected defenses against being stolen: namely, the previous wielders, who were able to manifest a physical form in the mental realm that was briefly shared between All for One and One for All.
Last season, Deku lost control , as it was empowered by his intense feelings at that moment. Ochaco had to grab onto him to get him to calm down, and Deku then slowly spent some time learning how to control it, as revealed in flashbacks from the previous episode. He should know by now that he has to keep a tight leash on his emotions in order to fight properly, so giving into rage was a mistake in more ways than one. While he had no way of knowing that Shigaraki/All for One could steal his Quirk, he already knew it wasn't a good idea to get too close . Had the villains not been so concerned with stealing One for All, Deku may well have turned to dust and died right then and there. Baiting heroes into making mistakes is one of All for One's favored strategies, especially if it means manipulating emotions to do so. Deku's cool head has long been the one factor that really sets him apart from other shonen heroes, and this incident has proved more than ever why that's important.
Fortunately for Midoriya, the vestiges of previous users were able to fend off All for One, but there's no guarantee that will work next time. Deku must work even harder to keep his emotions in check if he wants to protect 's world.