Bar associations are licensors that act as an ethical constraint and competence check on lawyers — and being kicked out of one (being disbarred) has direct impacts. The AMA is more of a professional organization — it publishes materials relevant to the profession (JAMA) and advocates and lobbies on behalf of medical professionals, but it doesn’t issue licenses or doctorates.
That used to be the role a union played as well. Before unions got all corrupt and self-serving, there used to be a better than market guarantee of quality and conduct when hiring union labor. Unions would train and discipline their members to meet the standards promised to the employer. That's why they were able to command better pay and benefits.