It's a little harder for programmers because the ethical bar is less agreed-upon. "Doctors should help people" and "lawyers shouldn't steal their client's money" are pretty nearly 100% agreed-upon by the professionals, but there's still a lot of disagreement on what is and isn't ethical for a programmer to do.
In what sense are they unions?
"Software engineers need to be protected from the employers" and "the public needs to be protected from software engineers" seem like very different positions, in fact I can imagine both organizations existing in a sometimes-adversarial relationship.
IMO setting high standards is a quality shared by any healthy industry, because permitting shoddy work means every consumer needs to learn the details of the task in order to judge their provider.
The idea being, if professional strictures were imposed upon us, that would give us a stronger ability to push back against those who set tasks in conflict with those strictures.