I am not a lawyer but...
Re: "If the process is illegal, that's hardly the fault of the programmers is it?"
The computer's defence is clear: it was only obeying orders. The programmer's defence is less clear. If she was obeying orders but by doing so told the computer to break the law, the defence that she was only obeying orders or that she was ignorant of the law doesn't hold water. She's as guilty as her boss.
In any case, the idea of regulating algorithms is a nonsense. Blame the humans, not the machines.