Thinking it over, Iād say The Super Mario Bros Movieā by establishing three thingsā actually did an okay job setting up why Bowserās loyalty took such a sharp turn:
His apparent lack of an emotional connection with his army, Kamek included
His confusing infatuation with Princess Peach
His admission that his wedding with Peach was out of a desire to ābe happyā
He desperately wants to be loved and canāt handle the loneliness of being surrounded by subordinate yes-men who rely on him for success, yet at the same time he canāt handle facing his own flaws. He wants the adoration of Princess Peachā a sworn enemy he sees as something of an equalā but reacts violently when sheās hostile toward his advances.
Then, after Bowserās defeated and locked away, not only is he placed in an environment that encourages quiet self-reflection, but he forms perhaps his first-ever genuine friendship with Luigi. He knows Luigiā having kicked his ass and locked him in a cageā isnāt some obedient peon, but at the same time heās compliant enough that he wonāt dwell on the past, even in situations where Bowser exhibits some glaring red flags.
By neither having anything to gain by being friends with Bowser, nor challenging Bowserās self-perception, Luigi earned his loyalty. Mario, on the other hand, still got under his skin, because he wasnāt willing to handwave the long list of war crimes for the sake of Bowserās ego. For good reason too, because despite all the progress Bowser has made in controlling his emotions heās still dishonest with himself; even at the height of his redemption he canāt help but rewrite himself as a victim who was āleft at the alter.ā
This leads me into the one and only time Bowser explicitly admits to any wrongdoing:
āMario, I was a terrible father. He must hate me.ā
āHate you? Your son tried to chop my head off just to free you! He wants to see you⦠he could just use some guidance.ā
Whether Mario realizes it or not, this was his accidental version of Luigiās ālove the colors!ā and the point at which he finally earns Bowserās friendship. Mario quells Bowserās fear that Junior hates him, and accidentally gives him a way to escape the guilt he was feeling about neglecting his son; guilty feelings that, as Luigi pointed out, were a huge step forward.
Then, Bower reunites with Junior, who gives him all the love and acceptance Luigi offered on steroids. Junior was wronged by Bowser, is powerful and independent enough to stand as his equal, yet adores his dad with the rose-tinted glasses of a kid. Junior repaints all the bad parenting and terrible advice as fatherly wisdom, reinvigorates the connection Bowser had with his army, and treats his dad like an innocent victim whose suffering was no fault of his own.
Between both movies, Bowserās loyalty shifted drastically between the good guys and the bad guys, but if you look closely his moral compass remained consistent. When he finally felt happy in the company of good people and genuine friends, he gave his all to please them. But in the end, despite his desire to change, he never genuinely cared about doing the right thing, and only cared about feeling loved. Naturally, the moment he was given an opportunity to feel just as loved without making an effort or acknowledging any wrongdoing, he fell right back into his old ways.