I believe that a trial court judge has the discretional power to "set aside" a guilty jury verdict -- in the same way a judge might rule a mistrial or throw out a case for lack of evidence.
I'm not sure if there are legal requirements that he must fully document or explain his reason for doing so (although in most cases one would assume that it would be for a lack of evidence, prosecutorial misbehavior, or perhaps for irregularities in the trial).
My take is this judge had the legal authority to do what he did, even if his reasons seem a little unusual.
If the state doesn't like it, the state legislature (I assume) has the power to remove him.