All of those professional associations were enshrined with their exclusive rights by law. We live in a democracy, and the law is at least nominally enacted for the public good. The case for requiring professional licensure was that it would protect the public from unqualified practitioners, and it would allow bad apples to be held to account.
If you want a professional association like engineers, lawyers or doctors, it needs to have a clear public benefit. Benefiting software developers is not enough. That is one of the important differences between a professional association and a union.
Disclosure: I am a licenced professional engineer (software).