The phone companies typically have strong privacy safeguards in place as they are tightly regulated and the potential damage due to any such instances becoming public is much more serious than any money they could make from selling your number.
However, most if not all of them contract out the installation to third parties. And this is where the "leakage" usually happens.
I just had my number changed to try and avoid harassing telephone calls. I have not had the number changed even a week, get a call from 952-852-6698, caller ID says Viking Magazine, never heard of it myself. Was so irate that I was getting unwanted calls and just paid to have the number changed, thought I would answer to see if they knew our name and sure enough they did. I cannot believe this. What are we to do to stop this crap.. I like all of you is sick of telephone calls and we have no idea who is calling or why and then they even know my last name.