tl;dr- Ethics modifies the behavior of ethical agents, regardless of determinism. For example, we can still judge a thief for their thievery to the betterment of society even if we choose to describe the thief's agency as 100% determined by physical processes.
Analogy: In video games – players have free will; but, characters are determined by physics.
Analogy, Part 1: You start playing World of Warcraft.
You're bored, so you download the famous video game, World of Warcraft. You create a new character,
AweomePants the Fiery, and log in to find yourself surrounded by many other players in a massive virtual environment.
We can consider 3 different notions of
AwesomePants the Fiery:
The free will of
AwesomePants, i.e. you.
As the player who exists outside of the game pulling the strings, you're the free will of
AwesomePants. You exist beyond the physics of the World of Warcraft, unbound by its rules.
The physical body of
AwesomePants, i.e. the character.
AwesomePants as a Human Paladin of the Alliance. As a new player,
AwesomePants is a level-1 character.
AwesomePants the character is an avatar completely bound by the physics of the world.
The totality of
AwesomePants, i.e. you playing the character.
AwesomePants is neither fully bound by the world nor free of it. Instead,
AwesomePants has a body in the world, but an ego that exists outside of it, controlled by you.
People playing World of Warcraft have their own ethical expectations, including rules for what's socially acceptable and notions of criminal justice.
Rough examples of the game's ethics:
You won't be faulted for things you literally can't control.
No one's going to yell at you for not running 10% faster because you can't; that's not a thing the physics of the world allows. Even if your failure to run 10% faster causes your team to lose, they can't blame you for not running 10% faster because that complaint doesn't make sense.
You'll be soft-faulted for things you could influence.
You'll be soft-judged for your performance in combat. This is, no one's going to fully fault you for sub-par performance because you can't fully select it, but they'll still tend to fault you in softer senses as you still have a lot of control over it.
You'll be hard-faulted for things you can fully control.
If you spam public chat with hateful, bigoted profanity, people'll hold you fully responsible for that because the messages you send are, for the most part (excepting typos and such), fully within your control. The harshest of punishments can be dealt out for such behavior as there's (usually) no reasonable excuse for it.
In other words:
Ethics doesn't fault
AwesomePants's physical body, as that's beyond control.
AwesomePants's totality, as that's within partial control.
AwesomePants's free will, as that's within full control.
Why, though? Why shouldn't people get mad at you for things that they know to be beyond your control? ...because that'd be stupid and unproductive, right?
Analogy, Part 2: Your free will is taken away as the game takes full control of your character.
You log back in one day to find that the game developers have implemented a new feature for a special event! Now, everyone's characters are being controlled by an AI.
You can still open the game and watch your character doing all of the normal things, but you're no longer controlling it. It's basically a movie that you're watching, rather than a game that you're playing.
..uh oh! Your character's yelling some really racist things in public chat! Guess no one can blame you, though.. I mean, that's 100% the AI's doing, entirely beyond your control. Seems completely unfair to fault you; they just gotta fix the AI. If anything, it's god's (the developers') fault for making the world that way – you may be doing what used to be the worst of crimes, but you're innocent.
And here's where we connect back to your question:
How can we be accountable if we are chemically programmed?
Clearly, it'd be inappropriate for the company that runs World of Warcraft to blame you, the player behind
AwesomePants shouting constant obscenities. It's actually their fault; heck, maybe you could take 'em to court and sue them for offending you by forcing your character to yell such things! (Not sure such a lawsuit would actually be viable, but you know what I mean.)
Analogy, Part 3: Your character can be banned despite you being faultless due to determinism.
At this point, your AI-controlled character is still spamming public chat with hate speech. What now?
Unfortunately, if they can't reform
AwesomePants (e.g., fix the bug), they'll have to ban
This is, the-totality-of-
AwesomePants will receive the worst possible punishment despite the abject innocence of the-free-will-of-
In other words,
AwesomePants is now 100% programmed, completely controlled by Determinism; there's no free-will to fault. But,
AwesomePants is still a malefactor that the ethics-observing agents of the world would seem to do well to rid themselves of.
Conclusion: Ethics acts on social agents, regardless of determinism.
The point's that ethics can act on social agents, like
AwesomePants, even if we understand those social agents to be deterministically controlled by the physics of that world.
In short, even if we suddenly strip away free-will from a world in which it existed, only the stripped-away free-will is innocent; the totality of the social-agent can still be productively held liable for its nature.
Addendum: Notes on omitted points.
I had to cut this answer short as it was getting way too long.
I was going to extend the story to talk about how, after the initial event in which full-AI-control was introduced, the game developers implemented a hybrid system in which players regained their ability to influence their characters, while the AI still controlled many more passive actions in the game.
For example, ya know how if you think about how you're breathing, you can control it? But then you forget, and your subconscious mind takes back over? It'd be the same thing: the player can take control in many cases, but when they're not actively managing something, then AI gets it. And then the player might have limitations on their control, where they can't always seize it from the AI.
This generalizes the video-game model presented at the start of this analogy, in which there was a clear distinction between the free-will-of-
AwesomePants and the physically-determined-body-of-
AwesomePants. Because, in actuality, there're a lot of interacting free-will's, and there's no clear dividing line between them and the physically-determined-body, making it a more complex picture that we can build up to.
In the end, none of this is an escape from the simple point that ethics-acts-on-ethical-agents; that "determinism" doesn't change the fact that ethical systems are socially beneficial constructs. However, it does go to help frame the unfairness I think that people can sometimes perceive. It'd be my contention that the perceived unfairness comes from the fuzziness of these models, where it's hard to attribute blame precisely to particular subordinate-agents within individual-ethical-agents.
Then I'd even want to comment on the implications of this stuff. But... that's long and complicated, so leaving off here.