One is optimizing/improving experience based on anonymous data, the other is building user profiles for targeted ads.
Mapbox is a fantastic example of mass data aggregation of users that has been anonymized.
EDIT: Why should we do clinical studies on medicines when that could be invasive to a persons privacy collecting such personal information? Is it necessarily wrong? Tools can be used for good and evil, that's the problem here, not the tool itself.