Did I do the wrong thing? (Please Help)

hayls
So, my boyfriend talks to this girl that he once hooked up with which I didnt mind for awhile. But her and my best friend started talking and all she did was talk about how my boyfriend is a great guy, and she tells him everything, and theyre so close, which then again I didnt really mind. 
Until, she started talking about how I was being a bad girlfriend for also talking to a guy ive hooked up with before. i feel this very hypocritical. 
Anyways, my boyfriend barely replies to me unless I try to get his attention yet Hes always talking to her! So I talked to him about it, because I feel like every relationship needs communication, and he told me he would stop talking to her if it made me that uncomfortable. But he still talked to her behind my back, and i didnt need him to tell me that, she told me herself that her and him talked all day WHEN HE NEVER REPLIED TO ME. so again I confronted him about it. He told me he wad sorry he lied and this time for real stopped talking to him. But I also realized that they were best friends, and he actually enjoyed her presence. was it wrong of me to ask him to stop talking to her because I felt uncomfortable ? Or should I have put my feelings aside for his sake ?