Publishing master's research while in a different PhD program I would like to ask about a situation when a research done as a part of a master's thesis at one institution is submitted for publication and published while attending a subsequent PhD program at another institution (US university). The content of the paper is mostly unrelated to the subject of study in the PhD program, and it is not supposed to be used towards earning a PhD degree e.g. by including it as part of the PhD thesis.


Is there something unethical about this? (I personally do not see any problems, but it seems better to ask anyway.)
Is this common, uncommon, rare? (It seems to me that such situations ought to arise whenever there is a master's thesis work that is to be published, because I imagine that rewriting the thesis into a journal paper form would be usually done only after the thesis defense, hence usually during another PhD program. Yet I do not know of any such cases personally.)
In that case, should one list as the affiliation the present institution (i.e. the university of the PhD program), or the institution where most of the work has been done?
It's fine.  Similar things will happen after the Ph.D., after job changes, etc.  Your current advisor doesn't need to be listed or involved in the process for work done elsewhere.
It is frequent (but unfortunate) that people write the thesis first and then produce articles.  However, I think it is better to be publishing along the way.  And this is not unusual at all either--so you are a little wrong that it is never done.  All that said, converting thesis chapters into papers is very normal and fine.
List the previous institution first with a footnote or parenthetical for current affiliation and contact email.  Do not list the old email.