Engineer A: Hey how would we know whether loading this image as a .webp vs a .jpg would perform? Our lab testing is one thing but the different hardware out there vastly differs from phone to phone -- we need some data on the whether the average phone has enough optimizations for one versus the other.
Engineer B: Oh, what if we just run a background task on some of the phones that tries loading an image that we don't show, just to get the metrics?
Engineer A: Hmnn, that could work, we could load just one image across some small % of the user base to get a representative sample and report that data to system X so we can get some statistics and make heuristics based off of that.
Ethics is not a strong suit/required reading for software engineers, so not every engineer will read the above and detect something wrong. Hell, running experiments on wide swaths of users without consent isn't quite above board ethically either, but we've got a whole technological trees and industry dedicated to it.
Most of the time the person with enough ethics knowledge to realize there's a problem here is more incentivized to alert legal (so they can add it to the EULA/ToS that users don't read) rather than stop the behavior.
I suspect many engineers could read the conversation above and not think there was anything wrong there to begin with. And of course, once X teams across Y companies start using this, we've got a problem.
Note that I use engineers for all the roles on purpose -- the idea that it's only non-engineers doing all the sketchy shit is a deflection of responsibility, I for one am pretty proud of George here -- he's turned down what is very likely a lot of money to do the right thing. We can only guess at how many do not take this route.
[EDIT] I want to note that I do not put myself above this conversation -- being able to recognize that this is wrong immediately is not some innate skill that everyone has, it has to be reasoned about, and often where to draw the line comes down to widely-enough-held social mores/morality.
For example, I run ethical ads on my personal blog -- I know that ads incur unnecessary load on user machines that visit, and in-turn burning unnecessary battery on visitors' machines. Am I the same as Facebooks' engineers that work on this system? Probably not, but explaining that completely (and convincing yourself or anyone else) is more complicated -- maybe it's only a matter of degree.