Ministry decision lacked coherent reasoning, judge rules