After removing an application in OSX 10.8 it still showed up in location services under the security and privacy settings in system preferences. (see picture below)
The reason is that it saves the entries in a binary plist file. You could delete the file and OSX will automatically recreate it. However you would have to re-authorize all the apps that you previously had authorized.
The following process shows how to edit the file and just remove the single application.
1. Start terminal and then sudo to a root shell
2. Navigate to /var/db/locationd
3. Make a backup of the clients.plist file
cp -p clients.plist clients.plist.save
4. The plist file is in binary format and to make it editable/readable you need to convert it to xml
plutil -convert xml1 clients.plist
Edit the file
5. Use vi (vim) to edit the clients.plist file and remove the application
6. The file will likely contain many application entries. Here is the format of a single application entry (Safari in this case). The entire entry needs to be deleted. (dd for deleting complete lines in vi)
identifier "com.apple.Safari" and anchor apple
7. Convert the clients.plist file back to binary format
plutil -convert binary1 clients.plist
8. Restart locationd daemon by force-killing it. Launchd will automatically restart the daemon
In case things go badly, then copy back the original file and restart locationd
cp -p clients.plist.save clients.plist
This should remove the invalid entries from the security and privacy tab in system preferences.