Apartment owners are required to make written contracts. If this isn’t in the written contract, the landlord cannot enforce it. I don’t think the landlord wins this one.
On the other hand, if the landlord starts putting it in writing as a term in future leases, they can do that. It’s their building.
However the law doesn't treat it that way for many other situations. Can the landlord refuse to rent to blacks, Hispanisc, Asians, unmarried women, families with children (narrow legal exception for seniors only communities), homosexuals, Muslims, Jews, communists, democrats or even ex-convicts? I think they would have a hard time excluding people for exercising an explicit Constitutional right.