UPDATE #2 : telling my friend her boyfriend said she sucks at sex..

My boyfriend and his best friend were talking about sex and their girlfriends. My boyfriend told me in private today that his friend said he hates Sex with his girlfriend and that she sucks at it and just lays there. At first I promised my boyfriend I wouldn't say anything. But then it got me thinking and I'm really good friends with his girlfriend and I would want to know if my boyfriend was saying this about me because sex is so personal and that's extremely hurtful. I told her and she really appreciated it and now my boyfriend is super pissed at me saying I violated his trust and he can't trust me anymore. Was I wrong for tell her ?? Like isn't that girl code? I love my boyfriend but idk if what I did was the right thing 
UPDATE: I can see where everyone is coming from but let me explain a little more..this girls boyfriend is legit a complete asshole and calls her a cunt and the only reason I told her was because he had ditched her with some drug addict guy and she was super upset asking if he even cares about her and that's why I told her. He is horrible to her and she was asking me if she should stay so I told her what he said to help her out a little 
Update #2: all you girls saying that it's not my business to share, he was saying it in a malicious way and it felt it was right to tell her. And all of you saying I shouldn't have told her, does that also go for cheating ? It's not my business so I don't get involved if someone cheats?? Where are the boundaries ? I thought there was girl code but I guess not anymore...