Star Trek was never intended to portray a realistic, consistent or well thought out post-scarcity society. You could probably describe the entirety of what's portrayed about that society on the back of a napkin.
It runs on magic and nonsensoleum (replicators, transporters and free energy, none of which can exist in the real world) and the unjustified assumption that humanity will simply abandon its vices and prejudices if presented with enough magical wish machines and space communism, rather than use those magical wish machines to manufacture weapons and drugs and rob banks and kidnap people with transporters.
Star Trek is just entertainment, and any attempt to read more deeply into it or extrapolate it into the real world, other than through whatever vaguely moralistic message the plot, itself, attempts to portray, is bound to be a waste of time.
It runs on magic and nonsensoleum (replicators, transporters and free energy, none of which can exist in the real world) and the unjustified assumption that humanity will simply abandon its vices and prejudices if presented with enough magical wish machines and space communism, rather than use those magical wish machines to manufacture weapons and drugs and rob banks and kidnap people with transporters.
Star Trek is just entertainment, and any attempt to read more deeply into it or extrapolate it into the real world, other than through whatever vaguely moralistic message the plot, itself, attempts to portray, is bound to be a waste of time.