Ruling could shake public sector unions’ financial structure and undermine their future stability