Anderson stepped down because he didn't really want the job, he's a soldier and not a politician and it was giving him undue stress almost to the point of developing a drinking problem, as his Shadow Broker dossier notes.
Another reason might be because as the human councillor, he'd not have been in a position to help Shepard when it came to them facing war crime charges for the destruction of the Bahak System and the Alpha Relay, whereas if he was an Admiral in the Alliance he could have.
Even as an Admiral he faces accusations of having a vested interest in keeping his former protege out of trouble, but as the Councillor, it'd have been to easy for him to be locked out of the proceedings by the others, as well as damage relations with the Council races if it looked like the human Councillor did not want to see Shepard punished.
Udina meanwhile cannot be accused of having that kind of bias, as it's well known that his relationship with Shepard is extremely strained and neither like each other. Udina taking over as the human representative on the council means humanity looks like they are taking this seriously and leaves Anderson free to go back to the Alliance and try to defend Shepard from there.
We know from Hackett's Shadow Broker dossier in ME2 that he's been pulling a lot of strings to keep Shepard out of trouble, even refusing requests that Shepard be arrested for treason for working with Cerberus. Anderson also says at the start of ME3 that we owe him "more than one", suggesting he's also had to put himself on the line for Shepard since his return to the Alliance.
This probably explains why the worst punishment Shepard received for their actions in ME2 and the Arrival was six months under house arrest on Earth, pending trial from an Alliance tribune, rather than being put on trial by the Council for having caused a major interstellar incident and antagonising the Batarians, a foreign power that already has extremely tumultuous relations with Council races and a hatred for humanity in particular.