The question of social responsibility of programmers (and other professionals) is not an easy one, and I think every programmer should think hard and often about the politics of their work.
Many programmers often dismiss such questions by saying that code in itself isn't moral or amoral, but what is done with it. But when you think more about it, it's just an easy excuse so that they can get on with their lives with a clear conscience.
There's also a big difference between buying some gum and having the tax you paid on it go to the military vs. actively developing military drones. I'd say that contributing to Linux would fall somewhere in between these two.
We have to function to have any hope of improving the situation. That does mean supporting at some level the thing we hope to fix.