Basically, at the end of the series, it's not only Marley, but other nations, who agree that Eldia and it's people must be exterminated. So, Eren uses the power of Ymir to instead kill everyone on their world, but Eldia. Obviously, he's stopped, but even after people see what their hate and prejudice created...in the end, Eldia is destroyed several years later, regardless. So, in the end, Eren was right to kill them all.
People here can argue about the quality of writing of One Piece and Naruto, but this is genuinely reprehensible.