We actually don't know why Udina suddenly turned Cerberus lap dog only EDI theorized that he was indoctrinated which I really don't see how that could have happened
This is one of my pet peeves. It's an event that gets some vague ideas from characters as to how it came to be, but is never explained fully.
Upon beginning ME3, I had hopes that Udina was going to be done justice as a character- upon first meeting him after leaving Earth he seems just as frustrated as Shepard is, and a person who, despite a past of personal differences with Shep, still has humanity's best interests at heart. He could have been portrayed as an excellent wartime leader- someone who is not necessarily well-loved, but is willing to do what's necessary.
Unfortunately this all thrown out the window once the Cerberus coup comes around. The writing capitalises on the fact that players saw him as antagonistic or just flatly didn't like him as a person in the previous games, counting on this so a player won't hesitate to gun him down when it comes to the final confrontation. Initially, I have to admit once Bailey showed up after killing Udina that I believed I'd been played, and that Bailey was the real Cerberus mole (LotSB dossiers alluded to as much). Sadly, I was mistaken. Udina becomes just another villain, and a few generalised explanations as to why he turned get wafted about afterwards, without really being expanded upon.
He was a waste of a more morally ambiguous character, who shouldn't have become a full-blown antagonist just because he wasn't liked.