> Gender is a protected class
Which means that businesses doing public accommodation are restricted from discriminating, but 'private clubs' (such as the Boy Scouts), who have a narrowly tailored interest that is benefitted by discrimination against a protected class is generally allowed (subject to variances within state law).
For example, a group for men who have been sexually molested by men would likely be considered presumptively lawful, but a group for men who also happen to be car salesmen would likely not be.
There are a number of details that need to be considered as well, as (loosely) prescribed by _Rotary Club of Duarte[1]_, such as exclusivity (it can't be publicly available to be overheard), and purpose (already covered), but if neither conditions are met, and a state law prohibits such discrimination, then it meets (at least) a rational basis standard.