Because there are sections of the law which allow exemption from the gender discrimination section for various reasons, and they have successfully argued that there are benefits to having a women only gym which are important enough to deserve an exemption (to provide substantive equality). They also only allow women patrons, so men are not charged for a service that is not equally provided.
I don’t really see it as problematic for a discriminated class to seek to foster a space free from those who perpetuate that discrimination
Neither do many other people, which is why such examples as Fernwood have received exemptions from the law and why there is a specific exemption in the laws for both female and male only clubs.
I don’t think it sets a precedent for protected classes to be discriminated against as “art” because men aren’t a class that needs protecting
Allowing discrimination based on gender without substantiating the businesses eligibility for an exemption under the law absolutely would set a precedent for the courts. While you may agree with this particular case of discrimination it is not a good idea to open an opportunity for more discrimination in the future - keep in mind it may not always be the type you agree with.