Palantir indeed has a lot of clients, but governments - and in particular, US federal agencies - are still the biggest and most lucrative customers. Nor is Palantir blind to what those customers are using the tech for - indeed, their whole point is "deploying" people to customer's premises so that they can work hands on. So when they do that for the ICE contract, say, they know full well what they are optimizing - proudly so. It's way more close and personal than what most of the big tech firms do (although you did list some exceptions).
But no, it's not illegal to provide panopticon-as-a-service to authoritarian governments, unfortunately. Especially not when you ask said governments.
As to what you can do to change this, I honestly don't know, and I say this as someone who resigned from NVIDIA recently because of this: https://nvidianews.nvidia.com/news/nvidia-palantir-ai-enterp... - but there's no shortage of people willing to work on this stuff. And in US at least I feel big tech enmeshed with the feds have such a strong lobby, neither major party is going to do anything useful about it in terms of passing laws making the business model itself illegal.
I don't think I want anyone quitting their jobs over this. Is democracy working or not? Let's make it illegal then. If people who vote are just not aware of this, then there needs to be a more organized awareness campaign, how can we help with that?
I don't think all this "lone hero" b.s. by engineers is useful. I don't need someone martyring their careers.
I didn't do it because I expected it to influence the decision makers. I did it because I don't want to be knowingly aiding and abetting the kinds of things ICE does.
But to answer your other questions...
No, democracy isn't working in US right now. Arguably hasn't for a while, but it's very evident now. Fixing that would likely require amending the constitution; a bar so high that at this point I'm confident that the system is more likely to self-destruct from internal contradictions than to reform.
At the same time, there are literally millions of people in this country who did vote for this and do want it. Even if they had an honest majority, it wouldn't make any of it any less evil. Democracies aren't inherently good.
But no, it's not illegal to provide panopticon-as-a-service to authoritarian governments, unfortunately. Especially not when you ask said governments.
As to what you can do to change this, I honestly don't know, and I say this as someone who resigned from NVIDIA recently because of this: https://nvidianews.nvidia.com/news/nvidia-palantir-ai-enterp... - but there's no shortage of people willing to work on this stuff. And in US at least I feel big tech enmeshed with the feds have such a strong lobby, neither major party is going to do anything useful about it in terms of passing laws making the business model itself illegal.