That does seems stupid...
How could they force the unions to represent people who were NOT dues-paying mambers?
I may be unclear on all the facts.
It is not at all uncommon for employees who have opted out of union membership to be required to pay a small (relatively) fee to pay for the benefits the union still provides; namely, collective bargaining for wages.
notice the judge did not state no membership required. The judge said you have to pay money.
IOW someone might have paid the judge.