Holden responds that
This is a people-shooting hat ... I shoot people in this hat' (Chapter 3).
This reply shows that Holden is clowning around, as he does quite often in the book - he is already wearing the hat the wrong way round, quite deliberately. However, this response maybe also hints at his pervasive sense of alienation from other people, his general inability to get on with his peers and older adults (although he enjoys the company of children, like his sister Phoebe).
In this chapter Holden is being persistently annoyed by Ackley, the student next door who has barged into his room and keeps on disturbing him when he is trying to read. Being unable to get rid of him, Holden resorts to kidding around.
In chapter three, Holden says that Ackley brings out the sadist in him. A sadist is someone who enjoys being cruel, so Holden jokes around with his hunting hat just to annoy Ackley. As a result, Ackley asks where Holden got the hat since it is being used to annoy him. Holden tells him that the bought it for a dollar in New York; whereupon, Ackley tells him that he got robbed.
"He took another look at my hat. . . 'Up home we wear a hat like that to shoot deer in, for Chrissake,' he said. 'That's a deer shooting hat.'
'Like hell it is.' I took it off and looked at it. I sort of closed one eye like I was taking aim at it. 'This is a people shooting hat,' I said. 'I shoot people in this hat'" (22).
Since Holden had mentioned previously that he was in a sadistic mood, his response here suggests that he's in the mood to kill and Ackley could be his next victim. Of course, he's kidding around. He's trying to annoy Ackley by not allowing his deer shooting comment to influence him to feel badly about buying the hat. He doesn't respect or like Ackley that much, anyway, so his response is somewhat passive-aggressive as well as a joke.