The no caste based discrimination perquisite is post TOS though. Ardana in The Cloud Minders defiantly had a caste based system and it was very discriminatory yet the planet was a Federation member. Kirk didn't tell them that they had to give up the caste system, just that they had to live up to their Federation obligations and provide the zenite. For all we know the Troglytes were simply provided with filter masks and the caste system remained essentially intact.
If the Federation had admitted Ardana and yet was unaware of the caste system then they'd be very lax about enforcing any sort of membership requirements.