In spite of all your good attention, kids at that age still haven't found "true north" on their own moral compass yet. They're still largely relying on parental direction. If he hasn't exhibited violent behaviour before . . . then he may simply be acting out what he has seen on TV or something, rather than it being an emotionally fuelled rage. I have 3 grown boys . . . and they displayed aggression at times around that age.
If you can gently prise out of him what really motivated him, using the suggestions above, this will help in deciding what course you should take. Be sure he understands the seriousness of such an act. And look for signs that he truly gets the point.
No, I don't think you are a failure as a parent . . . your level of concern is proof enough. Perfect kids are genetically impossible.
Take heart and take charge.