You don’t think the Federation is good? Or you don’t think it’s an empire? I think it’s an example of an empire that is depicted as good (because it’s the US empire depicted from its own POV).
And it’s definitely not the US represented from its own point of view. It’s Gene Rodenberry’s vaguely social-democrat wishful idealization of what some wish the US were like. Wasn’t even very representative of 1960s