Section 15 of the Equality Act as I understand it says ...
We might be looking at a different Act. The part of the EA2010 that's applicable to Associations (itself a defined term) is Part 7, beginning with section 100. Section 15 of the EA2010 is about discrimination arising from disability.
But it does have to be a proportionate means to achieve a legitimate aim. You can't say "no gays in this pub, straights only" or ban pregnant women from your gym, that's discrimination.
You cannot compare pubs and gyms with associations: a pub is a public service and not an association. Likewise a gym. The exception allowing for single-PC associations doesn't apply to pubs or gyms. It has nothing to do with proportionality or legitimate aim in either case. You can have an association for straight people only.
Pregnancy: As an aside, there are lots of situations you are allowed to discriminate against a woman because of her pregnancy where safety is concerned. A gym might actually be one of them. I'd have to look.
Everyone has protected characteristics. That's not free licence to exclude willy nilly as I read Section 15.
Associations do have free licence to have membership that includes only certain PC's willy-nilly, except on the grounds of race. See schedule 16 section 1. Services and employers have different rules.
The "proportionate means to a legitimate aim" comes in to allow indirect discrimination in situations where direct discrimination isn't legal and in some other places. It's not relevant to the GG context.