I honestly don't know the answer to this: How much are people able to choose to work on OSS projects vs. being told "This is the project you're working on."
Also, OSS tech that's in service to ad tech may still not be enticing. Even if it's not directly used for ad tech, everything you would do for facebook would ultimately be for the purpose of ad tech. Rationalizing that your particular work has non ad-tech related applications seems like just that: a rationalization. Other companies offer OSS work opportunities, as well as the opportunity to carve out, say, 5-10 hours a month to the project of your choice regardless of your day job.
I'm not coming down on one side or the other of such a moral choice. I don't think things are that simple. I think it's a spectrum, and people should weight these things when making a decision, if they have the luxury of doing so.
And I have to say, at this point ad tech is probably only one of a few major problems with Facebook content. News feeds, memes, etc. that are rewarded with shared & likes for being the most inflammatory/emotionally manipulative are at this point at least as bad as micro-targeting of ads, and I personally think are much much worse.
Very few things are purely good or purely bad, which should be a caution against all-or-nothing judgements. For example I think Apple is bad for inching its way towards an ever more restrictive MacOS. But I think Apple is good for its efforts to protect user privacy and give users more control over it. And as a FAANG, it's example puts pressure on other companies to compete on privacy as well. (Though I think we know Google will never go that way, unlike Apple their business model isn't based on hardware or software sales, but on the very private information Apple wants users to have control over)
So does the US govt. Does that mean you will reject a grant from them for your cancer cure or solar panel research? Less evil USians will die from cancer as a result potentially, along with the rest of the world.