The impression I got was that Jiraiya turned down the offer of becoming hokage in favor of Minato. Orochimaru was once a good man before he became obsessed with immortality & knowledge, and was once Sarutobi's star pupil.
Orochimaru was a villain in part one but that was over once he was defeated by Tsunade allowing her to surpass the previous hokage by defeating him. But he couldn't be killed because he was the one that was going to train Sasuke, and the reason he leaves the village. So he stays around till he is defeated by Sasuke once he done training him, and sealed by Itachi once even his power was no longer needed. So that was the end of him.
However during the war arc someone got the bright idea that it would be great if some revived the old hokage, and had them join the good guys. However, not many people knew the resurrection technique. They couldn't use Kabuto because he needed to be defeated by Sasuke for his flip-flop again. So they brought back Orochimaru who knew the jutsu, and conveniently knew how to revive the hokage without grave-digging. So despite being a villain the was still evil, as well as still desiring Sasuke's body, but its the end of the world so he is helping the good guys. So he becoes a bored aid to Sasuke that help save the world, and because the story ends before they can deal with him. He is let go.
Then with the new series coming out they needed a third team member (clearly the lee clone was not good enough.) So an executive decision because orochimaru is popular, kishimoto out of spite, or someone thought it was a great idea; I don't know. Someone decided that Orochiumaru's son should be the third team-member allowing Orochimaru to remain relevant to the story. Though I doubt theme's were involved what so ever. Those were abandon with the rest of the story for Hinata.
When you put it that way, that sums it up.
I feel like they didn't know what direction they wanted to take Orochimaru...kind of like everything else in this series...
Anyway, when Orochimaru first appeared, he was a monster of pure evil. It was clear he was being paralleled with Sasuke, and I thought that was pretty well done. It seemed consistent up until the Taka arc. He becomes a snake, tried to devour Sasuke, and gets sealed. He breaks free and gets sealed AGAIN. When Kabuto is absorbing Oro's cells into his body, we assumed he was replacing him. But no...he gets revived again. At first, I thought he was an ally of convenience during the war; it had to mean something when he got his jutsu back and him saying he was willing to go in whichever direction Sasuke chose (and lost interest in possessing him...for some reason). After that, he just does his experiments and seemingly doesn't bother Konoha. Even his son (clone?) is welcomed. Except we find out that Naruto has been allowing this IN SECRET and now everyone is calling him out on this.
From a writing standpoint, Orochimaru can't be redeemed; his turn to the dark side was purely selfish. His parents died, he didn't want to die, and what does he do? He butchers people to learn about immortality. He was responsible for the death of his teacher, killed the kage of a sovereign village just to take his place, sacrificed his own minions for Edo Tensei, continues to experiment with people and...well, I think there was a comic hinting at what else Orochimaru would be up to...
And the author gives him immortality. Why? I guess he got what he wanted, what more harm would he do? I'm sorry, but unless I'm trying to make a point on how bad people often get what they DON'T deserve, this is a disturbing message: Hey! Do whatever it takes to achieve your dreams, even BAD THINGS.
Thing is, if authors keep bad guys alive so they can be used again, it's either because a) The protagonist isn't a killer/wouldn't kill this particular character or B) Find a better plot device to explain why they're still around.
You know what could have worked? Orochimaru dies somewhere during Shippuden. At the end, there's no sign he's alive. No appearance in Gaiden. Mitsuki? Maybe some Konoha nin found him in a stasis tube and Naruto took pity on him and adopted him, but still supervises him. So, if Boruto HAS to fight and meet Orochimaru, we can pull that thing with Anko's seal during his time. Think about it: Sasuke was the only one who knew about the seal that would revive him. If we take that away, we could have Orochimaru revive himself during the current generation, and it would make for an interesting arc. It could set up a more believable conflict between Naruto and his son: Boruto wants to fight Orochimaru, but Naruto understands how dangerous he is and forbids it. Maybe he goes to possess Sarada this time. Maybe instead he temporarily turns Mitsuki on the others. Had they used a surprise resurrection now, there are many genuinely interesting possibilities for them to play with.
But of course, SP is too lazy and just want him to hang around with Naruto's approval.
It's kind of like if someone would have been stupid enough to release Phillip Garrido...oh, wait...
It also undermines Orochimaru as a VILLAIN. I know shonen likes to play with tropes where bad guys aren't pure evil, but they have enough sense to know when some characters aren't meant to be redeemed. Like Naraku. Or Shishio. Or Father. Others I'm probably neglecting to mention. Kishimoto's actions to show not everyone is pure evil is well intentioned, but it is horribly misplaced and even he admitted this thinking is naive and only did it because the tropes of Shonen demanded it.