There is no excuse for what that judge did. That said, all I have to add is my agreement that judges and immigration people* can certainly get to feeling all-powerful--and in fact, many times they are; enough times so that they may come to see themselves as omnipotent--which they aren't.
Just FTR, I had to look up mens rea.
*To say nothing of the IRS (can't say about tax offices in other countries). But legislation is under way, here, to restrict their power somewhat.