He should have made her wipe that ****in smirk off of her face right away rather than goofing on it and basically encouraging it. By making a joke out of it, he was encouraging her to take it lightly.
Dick move by the judge. Don't allow a light hearted atmosphere if you're going to flip on it as soon as someone says bye to you. Be consistent.