Why did my ex boyfriend give my number to his friend??

Me and my ex boyfriend broke up last month because I put a domestic violence restraining order against him. We used to hang out with one of his friends and his friend seemed to like me as a friend too. I haven't spoken to him ever since the restraining order was placed but yesterday I get a call and find out that it's my ex boyfriend's friend.. His friend was pushing onto me and I asked how did he get my number and he told me that my ex gave it to him. I felt so hurt and disgusted. Why would he do this ☹️