He was not happy with the judge's revocation of his bond, and decided to call him a slang word for male genitalia. Then, after being sentenced to 60 days in jail for contempt, he did it again, receiving a second 60 day sentence.
A judge has the legal power to control his courtroom. That MUST be the case, in order for justice to function, otherwise there would be no way to hold court. This power is nearly absolute in the courtroom, especially when court is in session.
Not so much when outside of the courtroom.