Why is he jealous if he rejected me

So he’s my best freind and I caught feelings for him well he told me he’s gonna tell this guy how much I loved him and also he was joking he would hurt him we had an argument today and he said u don’t need me u have ur boyfriend now I’m sure he’ll always be there for u why is he so jealous