I'd be more interested in a guild or craft association than a union. I don't find collective bargaining, closed shops, standardized pay schedules, and some other features of unions to be compelling.
The bar is an accreditation and verification system as well as a means for upholding ethical standards across the membership.
In short, a math major with a CS emphasis should be allowed to take the exam. Or, in my opinion, even someone who is just really great at self study.
[1] I know, there are some alternative paths in law, but still very limited.