You are misrepresenting the facts. These parables seldom directly involved the Federation they were things encountered outside. The crews did their best to answer these challenges according to their evolved values, Federation values.
Oh, and I don't think the Fed represents America at all or is meant to rather it is meant to be an actually effective UN.
Take this famous scene the Federation does not understand racism because humans evolved beyond the horrid concept, that's the future I want -
Edit - Sadly, I can't find the extended clip in which the Bridge Crew briefly discusses the two aliens' puzzling & futile feud and it is asked if hatred is all they ever had to which Kirk replies "perhaps".