The goal is to avoid names that are too identifiable with a specific individual -- either because there's only one person in the country with that name, as stated above, or because there's a real person with that name who comes too close to the character's description, e.g. having the same job. For instance, in the Dresden Files novels, one of the main characters is Chicago detective Karrin Murphy, but for the TV adaptation, the researchers learned there was a real Chicago detective named Karen Murphy, so they changed the character's name to Connie Murphy for the show.
Indeed. Here's an obscure example of this policy of legal clearance on Star Trek
, from a May 29, 1967 de Forest Research memo for "Amok Time":
Admiral Westervliet -- There is a serving Captain in the United States Navy, Westervelt. To avoid conflicts, suggest: Komack, used in previous scripts.
Either this issue was later resolved or the name slipped under the producer's radar since an Admiral Westervliet later appeared in "For the World is Hollow and I Have Touched the Sky," although the name wasn't spoken on screen. (Interestingly, the same actor -- Byron Morrow -- played both Komack and Westervliet. I wonder if the name slipped into the end credits of the season three episode by mistake?)