He clearly needed to be stopped! Don't feel guilty, everything happened so quickly that it was probably hard for you to control your emotions. It's really hard to detach yourself from a situation and respond in an appropriate manner when things get personal.
It's hard but as long as you are generally have good self control most of the time, don't beat yourself up about it, it's not gonna help at all. What I'd suggest is, try not to respond emotionally to situations because you'll generally end up doing something you regret. As soon as you feel an emotional response (anger, hurt, humiliation), try and stop to think for a second. Are you going to regret what you're about to do? If so, try and think of how you would like to react.
In this situation, you did the right thing by stopping the guy, but to 'beat him up senselessly' was not necessary. But as long as you understand that, you should be fine. At least you recognise that loss of self control is not something to be encouraged and you're trying to improve.