WASHINGTON, D.C. - The U.S. Supreme Court has dealt a blow to public sector unions, holding that government workers who are represented by a union, but choose not to join, do not have to pay to cover the costs of collective bargaining.

The nine-member court ruled 5-4 that such dues, often called "fair-share fees," clash with individual rights. The fees violate "the free speech rights of nonmembers by compelling them to subsidize private speech on matters of substantial public concern," the majority wrote in its decision in the case, Janus v. AFSCME.

The ruling Wednesday fulfills a longtime wish of conservatives to get rid of these fees, which non-members pay to unions in roughly two dozen states. President Donald Trump tweeted immediately after the decision that "non-union workers...are now, as an example, able to support a candidate of his or her choice without having those who control the Union deciding for them."

His tweet is wrong: Unions were already not permitted to use funding from non-members for political activity, an arrangement that was in place for 41 years. However, the plaintiff in the case, Mark Janus, argued that paying any money to the union that represents him constituted political speech. That's because the union's bargaining for higher wages and benefits on behalf of its members directly affects issues like government spending by his home state of Illinois. This mirrors an increasingly common conservative argument that sees the very existence of unions as inherently political.

The decision, which was widely expected, is likely to devastate funding for public sector unions, including those representing teachers, police officers and municipal workers.  

While workers can choose whether or not to join a union, unions are legally obligated to bargain for everyone in a particular work group. Across the border from Illinois, AFSCME Iowa Council 61 enjoys an overwhelming 83 percent support among covered workers -- but only 29 percent of those workers are dues-paying members. 

"It is likely that today's decision will lead to greater instability in state and local workforces," the Economic Policy Institute, a pro-labor think tank, said in a statement. "The recent teachers' strikes in states like West Virginia and Oklahoma provide important examples of the effect of denying workers the right to effective collective bargaining."

The court left open the possibility of some 

The Associated Press contributed to this report.

© 2018 CBS Interactive Inc.. All Rights Reserved.