Gay clubs which are open to the public can't generally discriminate against serving anyone on the basis of their sexuality either. People will self-select in, but they can't refuse to serve someone on the basis of sexuality.
In a lot of cases where there really are "rules" of that kind what you really have is something more like a private club type situation. Those can admit, or not, whomever they like, whether it is legitimate, or sexist or racist, or whatever.
You can sometimes have situations where discrimination is seen as being proportionate for a legitimate aim, such as in a clinic, or sometimes age based communities.
Things like "being around people who are similar to you" does not really fall under that. The thing to remember is that with protected characteristics, the exceptions can potentially apply on both sides - it's not weighted to try and redress some kind of balance. Every individualI is protected for discimination agsinst them on the basis of their sexuality, be it in a bar, or buying a house.
And following from that, if straight people had specific health needs that would best be managed by having a special clinic, it would be totally legitimate to have such a thing under the exceptions.
If just wanting to live in a community of people who share your sexuality is legitimate reason for gay and lesbian people which justifies discriminatory renting policies, it is also legitimate reason to have a straight community for people who just want to live with other straight people.