Honestly that wasn't true in the TOS era. There are mentions of planets in the Federation who still practice slavery; and you even see an example of a culture who keeps an entire class of people as effective mining slaves in TOS S3 "The Cloud Minders".The Federation lets member worlds have their own unique cultural laws unless they violate the basic citizen's rights of being a citizen of the wider Federation. If Vulcan has weird, off-putting marriage laws they get to keep them so long as Vulcans' rights as Federation citizens aren't violated and their basic individual freedoms are respected.
^^^
Yes, by the end of that episode Kirk & Co have begun to change the status quo in the city of Stratos, the Federation allowed the world to join, and didn't require any change to its government to be a member. And it's pretty clear that the planet has been a federation world for some time, and not a word was said about the fact that the morning caste we're in effect slaves to the intellectuals who lived in Stratos.
So yes maybe things changed by the 24th century, but in the 23rd century; the Federation basically let its member planets run their governments how they liked; and didn't really comment on any aspects of their cultures.