It is not normal, but it can happen. Usually under such circumstances the article is handled by a different editor, and the submitting editor is treated as would any other person submitting to the journal.
Also note that a paper can be submitted to a journal like Physical Review Letters, and them get transferred to another journal where the conflict could be created. (This happened to a colleague.)
In my field (Epidemiology) it is quite common to publish in a journal where you are an associate editor. It's a fairly regular thing to see articles with authors who are also on the editorial board appear in an issue of the journal, and no particular fuss is made about it.
If nothing else, the Associate Editors for the American Journal of Epidemiology is both quite large (well over 70 people), and in some cases make up a large chunk of the senior faculty of a given department. With how prevalent collaboration and large co-authorship papers are in the field, not submitting would lock huge swaths of the field out of a particular journal.
AJE also has one of the most robust paper anonymization systems I've encountered for review, which I think makes the threat of any particular conflict of interest fairly small.
It is entirely normal, with some uncommon exceptions. For instance, check out how many publications Prof. Tony Cai (former Editor in Chief) has in The Annals of Statistics.
In this case, the papers have to go through the usual peer review process, handled by another editor/AE.
I do not think the situation you describe necessarily creates a conflict of interest, and thus I believe there is nothing inherently unethical about publishing from time to time in a journal where you are an associate editor.
The question, as Anonymous Mathematician nicely phrased it, is more "what measures does the journal take in this case?" At a minimum, it must be a different editor who handles the paper, maybe the editor in chief. And the system must be designed so that the anonymity of the reviews cannot be breached by the author/editor.
If this is enforced, then I don't see any major ethical issue. The one risk I see is that the author/editor might get a slightly more "deferential" treatment, but this is also a risk for some other authors, e.g. big names in the field. One case which might become worrying is if an editor were to submit the large majority of his papers to the journal he works for... Even if everything is ethically above board, it may look like collusion, and should probably be avoided.
Now, I want to highlight some reasons why it is desirable that editors are allowed to publish in the journal they work for.
If they are editor for a major flagship journal in their field, it is not fair to ask them, their students and coworkers to avoid it entirely. It could make a large negative impact on, e.g., graduate students' careers. (Imagine a chemist who could not publish their major work to JACS, or a physicist to PRL.)
If they want their journal to succeed, they want to attract the best papers. If they rightfully believe that their own work is good, publishing it in the journal will sustain its quality. I am not an editor, but I do that myself sometimes: publishing in a journal because you think it's a nice venue for the community, and you want to help it grow. I imagine an editor, who wants the journal to succeed, might feel the same.
There is nothing wrong with an editor publishing in the journal with which they are asociated. Put it differently, why should ones right to try to publish somewhere be limited?
All editors, at least should, be aware that publishing this way has some possible repercussuins. If an editor starts pouring out works in "their" journal, it will soon reflect negatively on both the editor and the editor. Hence, such behaviour is "self-regulating" in the longer term.
It is of course possible that a research field is very narrow and so the journal may be the only major outlet for papers in the field. In such a case there may be no escape but I would then also argue that the science community concerned may know each other quite well, peer presure should then be a major factor keeping things on course.
I am personally Editor-in-Chief (EiC; one of two, with 12 associate editors) for a journal. My fellow EiC has published one paper, I have not (there are enough journalsin my field so that it does not affect me too much). We make sure, in fact our electronic submission system ensures, any editor submitting a paper cannot see or affect it in the system. We also take care of papers from each others departments to avoid any suspicion.
So, the "problem" is quite common and unavoidable to some extent. It is only a problem if it is abused but that will likely soon back-fire on both the journal and the editor.