But Facebook doesn’t let advertisers query their database of private data. I agree that if they did, it would not be very different from selling data, but they don’t.
But.. they do, though. You can (and people do) make a very targeted ad, then query what users matched with it, and so on until you've sufficient data for your purposes. Plus you can use their public APIs to then match their ad data with the users public information. Facebook knows this, and does not prevent it (by hiding user identifiers for instance) because it's part of their strategy.