(Examples include things like magic numbers instead of #defines, use of strings instead of well-defined enums, pull requests with lots of commented out code. They can also go to deeper topics, like bad database schemas or poor data access patterns.)
Why must you pick a side quickly? If you treat incompetence or inexperience as an interpersonal dispute, you aren't managing. Instead, your team will quickly view you as appeasing incompetence, and this will quickly drain morale. This is especially the case if one person should be moved to a less-challenging role, or fired.
From personal experience: In these situations the technical lead fixed the code before merge, and management eventually pushed the other person out. But, it was a long slog while management tried to be diplomatic with someone who just wasn't willing, or able, to be professional.
In the case I was involved it was two very competent senior developers and the dispute was between a iterate-fast-and-learn approach, and a build-for-the-future approach. It wasn't clear which one was right at the time and I respected both their opinions. It became clear that it was growing from a technical disagreement into something much more personal. I let it go too far and felt like I needed to step in and pick a side. I believe that I missed an opportunity for them to come to a compromise and learn something about that experience, instead ending up with one very pissed off dev, and one that thought I was on their "side" from then on.
Sometimes you feel like you have to make a decision just because your in a position of power, when actually in many cases you can be there as a mediator, lowering the emotion and keeping things professional and let people work it out themselves.