Interesting review essay on the role of the editor in a book's success:
Red Pens and Invisible Ink by Colin Dickey.
Essential Edits takes the stand that we work for the author, so do our best to follow and bring to fruition the author's vision. We will from time to time, point out issues that might impact the book's commercial success—such as scenes in a YA that might be objectionable to teachers and parents, or content that might be negatively reviewed—but our job is just to flag potential issues, not to censor them.
This is different than the role of acquisition editors and agents, the people to whom one is trying to sell the book if not self-publishing: the job of the acquisition editor or structural editor at a press is to alter the book to fit the vision of the press, which usually translates as 'make it more commercial'. There is nothing inherently wrong about that, because they usually won't buy a book unless it is already (mostly) consistent with the publishers vision of its books; and most authors have no objection to making changes that will increase sales. Most publishers will not initiate the complete rewrites spoken of in the article above, because it is too time consuming and expensive for them...they will just look for another manuscript closer to their own needs.
Still, authors sometimes feel editors have gone too far. If you are an author and you are unhappy with the changes the editor is asking for after you have made them, then there is something wrong. Every author naturally hates making changes insisted upon by their editor—it's just human nature to resist the effort and ego-bruising that changing even a comma implies—but usually, after the author has calmed down enough to actually fiddle around making the change, they come to see that the editor was right, and that this revision is in fact way better. If you don't feel that way, you are either working with the wrong editor or misunderstood what the editor was asking for. (Or, I suppose, there are who simply do not believe that there is a single flaw in their writing, and that every editor who fails to recognize their genius is an idiot, in which case they probably haven't gone to an editor in the first place. Self-publishing has its share of those.) If you like your book less in the edited version, then stop, go back to the original. The freelance editor works for you and does not get to dictate their vision. A good freelance editor can help you realize your vision for the book. It is okay for them to make suggestions, and it is usually a good idea to at least give it a try to see how that would look, but if the editor/agent is telling you to change the gay character to straight, the black character to white, or to add pointless sex or whatever, time to walk away.