In some fields, authors of a paper are not ordered alphabetically; rather, their order carries some meaning related to the authors' contributions to the work. See What does first authorship really mean? for more details. In these fields, readers of a paper make certain assumptions about the role of each author, depending on their placement in the author list.
For example, in my field, the first author is typically the person who was the "main" contributor, and the last author is typically the person with the greatest supervisory role or the head of the research group where the research was carried out. The middle authors are the least important. Thus if my name is first in the author list, readers of my paper who are familiar with conventions in the field will assume that I was the main contributor to the work.
Under these circumstances, is it ethically problematic to use a different author order, assuming this is acceptable to the authors? (Putting aside issues of who does and doesn't deserve to be an author; let's assume all of the authors have sufficient contribution to be considered authors, and we are only concerned with order.) Do I have an ethical responsibility to protest if this happens on a paper where I am a co-author?
For example, suppose I co-author a paper with an undergraduate research assistant, and I do most of the work. According to conventions in my field, I should be listed as the first author. But maybe I don't really need this first-author paper, and my undergraduate student does (it would really help him get into graduate school), and I'd happily give up first authorship so that he can have it. Is this ethically problematic?
Or, suppose a senior author, Prof. Z, wants to be last on the author list. If Prof. Z is listed as the last author, the paper will be thought of as having "come from Prof. Z's group". The author who really should be last (based on having been the main supervisor contributor), Prof. Y, is OK with this arrangement (as a favor to Prof. Z, or to avoid an argument). Is it problematic to give last authorship to someone who doesn't really deserve it in this case, and should other co-authors insist on the conventional ordering?
The potential ethical issue is that readers may be misled about the role of the authors, if the order doesn't reflect the contributions that will be assumed based on conventions in the field. I'm not sure if this is a real problem, or if I'm overthinking it, though.