Engineers have bosses, and they generally do what their bosses tell them to do.
So the responsibility should lie, as usual, with the people at the top, who set the direction for the company, not for low-level peons like engineers, who might be highly compensated, but the engineers don't set the direction for the company nor make the ultimate decisions regarding these algorithms.
But part of the tragedy of organizations is that responsibility tends to be diffused, so it's really hard to ultimately blame any one person.
There was a documentary (maybe called "The Corporation" or something) which showed some protestors outside some CEO's home, and the CEO's wife went out with some tea and cookies or something and invited the protestors inside their home to have a chat, and the CEO talked to the protestors and told them how helpless he himself was, as he was just part of the system with relatively limited ability to change it.
I'm not sure I buy that, and not sure the protestors did either, as the CEO still has enormous power. At the very least the CEO has the ear of the board of directors, and quite a lot of leeway as to how to run the business. They might not be able to change it all, but they can change a lot. Still, there's no denying that especially in a large organization no one person knows everything that's going on and can be accountable for absolutely everything, but leadership still exists and still is ultimately responsible.