When you have wronged as many people as Kenshin has during the Bakumatsu, sooner or later, those individuals will inevitably come seeking retribution. When that happens, any friends Kenshin made would be caught in the crossfire. Kenshin can live in a fairy tale and believe that protecting the innocent and giving up killing would make his sins magically disappear, but all evil deeds stink. You can forget them for a while, but they don’t go away. Based on all of this, Enishi deserved his revenge against Kenshin and it would have been better for the story if Kenshin did not have a happy ending. People with a past as checkered as Kenshin’s don’t deserve a happy ending.Grady Brown, “Kenshin’s Comeuppance”
I can see where Grady Brown is coming from here even though I haven’t bothered to read that far into the manga (and though it’s been a while, I don’t think the anime ended the same way).
However, I think it helps to bear in mind that Rurouni Kenshin‘s subtitle is “Meiji Swordsman Romantic Story”. Presumably the emphasis is on “romantic”, and nowadays you can’t have a romantic story in either sense if the protagonists don’t get a happy ending—even if they’ve got to suffer in order to “earn” it.
One might also bear in mind that writing serialized manga is a job wholly dependent on fandom appeal. You can even be a pedophile as long as you’re discreet about it and keep the fans happy. Why? That’s just how modern capitalism works.