A quick Google says a landlord can exclude people, but not if it's illegal. For instance if it's discriminatory, eg if they're female, or black, or any other protected characteristic.
And certain beliefs come under the protected characteristic category.
And belief that sex is immutable is specifically one of those.
Here in the UK, legislation is much the same. Any business does have the right to refuse to provide a service, however, it’s important to ensure this is not discriminatory. If a business refuses to serve a customer on discriminatory grounds, it is illegal. Discrimination includes issues such as gender, sexuality, ethnicity, religion or disability, which are all protected characteristics.
Although this specific source (Insurance), gets one of the protected characteristics wrong. I'm finding the same information from several sources.
I don't know if a landlord could get around it by saying they are excluding you, but not giving a reason. But if they say it's because of your T-shirt containing a belief that is protected, it appears that would be discriminatory.
Maintaining single sex spaces is only achievable on the basis that there are certain exceptions to discriminatory practice.
The default is 'no discrimination'.