Holden is an underage teenager who is suffering from survivor's guilt and trauma because of the leukemia death of his brother Allie. He acts out in inappropriate ways, but he also is immature and lacks guidance about how to deal with his grief and pain. He is not fully responsible for his actions. People around him like his roommate Stradlater and his teacher, Mr. Spencer, don't understand what he is going through. Nor do the people he interacts with in New York City, with the exception of Phoebe.
Examples of Holden acting out without fully knowing what he is doing would include damaging his hand by breaking out all the windows in his garage after Allie dies. It seems clear that he was overwhelmed by emotions he had no idea how to handle and was lashing out in whatever way he could. As Holden describes it:
I slept in the garage the night he died, and I broke all the goddam windows with my fist, just for the hell of it. I even tried to break all the windows on the station wagon we had that summer, but my hand was already broken and everything by that time, and I couldn't do it. It was a very stupid thing to do, I'll admit, but I hardly didn't even know I was doing it ...
It is telling that Holden was hardly aware of what he was doing.
A few years later, Holden, despite psychoanalysis, has never fully dealt with the pain he feels that he could not save Allie. To compensate for his inability to protect Allie, Holden fights with Stradlater because he fears that Stradlater has taken advantage of another person Holden puts into the category of innocent, Jane Gallagher. Holden provokes the fight to reassure himself he is protecting Jane, but also because he seems to want to be punished by being beaten by the stronger Stradlater. The fight is self destructive, but Holden lacks the maturity to understand that unresolved emotions over Allie are resurfacing. He knows he could not fight the leukemia himself, and that frustration spills into many other areas of his life.