I think having the question "Is what we are doing morally virtuous?" hang there as a Sword of Damocles[0] is the way to go.
Sure, few things are 100% morally virtuous. But the fact that you cannot achieve perfection doesn't mean you can or should stop trying.
I see this kind of reasoning a little too often and it's a slippery slope to moral bankruptcy. Once you accept trading in part of your morals, all of them end up for sale, eventually. Instead, trading in morals should be a bloody tooth and nails fight. At best, you should only trade them in temporarily and never should you make your livelihood depend on your trading them in.
We should be as terrified of losing our morals as we are of losing our lives because once a critical mass of our morals is lost, our lives are no longer worth living.
Only once we are all truly terrified of losing our morals, constantly, will we stop not only producing bad (as in: truly questionable) technology, but also using good technology for bad.
The difference between a good and an evil person isn't that the good person is perfect or unfailing. The difference is that good person hasn't stopped trying to be good.
[0] http://en.wikipedia.org/wiki/Damocles (including this here because it's an educating read, even if you think you know about it)
For my part, I refuse to work on tech that is a 'single-bladed sword'; I'll work on something that has broad application, but not something with only 'immoral' application.
The crux is where to draw the line of morality. I think that's a reasonable discussion and worth deeply conversing about; morality is both an individual and community affecting thing. Both your self and your community need to consider it.
Rightly divide the words spoken and think about whatsoever is true, just, and commendable...
Anyway, let's tackle (for a thought example) your example. Why should Tor exist? It's a home to real creeps. (Freenet has the same problem).
What precisely do these services offer that is so compelling that it's better to let them exist?
Freedom? Privacy? Are those sufficiently compelling? Why so?
I'm sure there are off the cuff answers out there - but maybe we should look deeper.
Possibly, if that technology also allows us to, says, cure cancer?
Hyperbole aside, putting workers out of jobs are apple-and-watermelon different than "helping" the military industry (spying or otherwise).
And I'm fairly sure that the complaint of too much focus on the ads industry isn't particularly rare either.
It was actually the basis for my adopted quote:
“The best minds of my generation are thinking about how to make people click ads, that sucks.”
What you are calling a "double standard" is actually a false dichotomy.
There is also a double standard here, isn't it? Working on Big Data technology that has applications for spying by the military = evil. Working on search or data classification technology that has applications to obsoleting workers and putting them out of a job = not evil?
It's not a productive path to start treading down. Or at the very least, something about glass houses or "let he who has not sinned cast the first stone."