Looks like he had a chance to save his job and blew it with some petty antics.
He likely thought his job was pretty secure, having met with President Elect Trump. He decided to be a wise guy and show how much he held to the letter of the law (if the President is not supposed to communicate with the DOJ lawyers) and got a big surprise. After hearing this was the guy who prosecuted Dinesh D’Sousa, I’m glad he’s out.