I guess he does that in order to show clearly that his personal opinion is that the flag stands for racism and that he despises it.
I don't see the hypocrisy. The judge must separate between his personal opinion and what the law says. All judges will be in a situation like that from time to time - that the law doesn't say what the judge would like it to say. But in any country where there is a separation of powers (typically the classic legislative-executive-judicial separation) this is natural. The job of anyone in the judicial system is to give court rulings based on their interpretation of the law. Not based on their personal opinion on what is wrong and what is right.
My opinion on the matter is that as long as the state of Mississippi keep that flag, they lose out on an opportunity to say clearly "the days of racial discrimination are behind us". But it is not a legal matter.