Unions offer a remedy to workers who don’t want to support their political positions, but it is cumbersome. They must renounce their membership, write a letter annually to opt out of political spending, and then wait for the union to send them a check for the percentage of their agency fees it says it spent on politics.

Justice Samuel Alito’s majority opinion rejected that solution. The problem is that the onus is on dissenting workers to ensure the protection of their First Amendment rights. They must write opt-out letters (often year after year) or risk underwriting union political activity they oppose. The opinion called the process “daunting.”

The Janus case also underscored the inherent problems of giving public-sector unions the power to unilaterally decide what constitutes spending on politics versus collective bargaining. Justice Alito argued that the “line” between the two “has proved impossible to draw with precision” and resulted in endless litigation. In the private sector, unions bargain with employers and direct their political activity at the government. But in the public sector, unions’ political activity cannot be separated from collective bargaining because both concern the government.

The subjects of negotiations — employee pay, benefits, work rules — are political questions about how to spend tax dollars and best provide public services. So, unions’ demands for better pay and benefits are, in effect, political positions that nonmembers are forced to underwrite.

The court’s decision will weaken but not destroy government unions. One study estimates that the state and local public sector union membership rate in collective bargaining states, 53.7 percent, will fall by 8.2 percentage points. The experience of states that have recently passed right-to-work laws suggests that some public unions may lose 10 percent to 30 percent of their memberships. Such declines imply losses of tens of millions of dollars in dues money. State and local government unions will come to resemble unions in the federal government, where agency fees are prohibited.

Major organizing efforts to stave off membership losses have been underway since 2014. Across the country, unions have been surveying their members to find out their priorities and asking employees to sign new union cards. Even with reduced memberships, public unions will remain potent forces in many states.

Nonetheless, taking public unions down a peg has another important effect: It will rebalance the playing field in states where the power of unions make it impossible for governments to address the rising costs of pensions and retiree health care, which are crowding out other spending. Oregon, for example, has $25 billion in unfunded pension liabilities, but the public employees’ union has adamantly opposed increasing members’ contributions.

In principle and in practice, the court’s ruling is a good one. It protects public workers’ constitutional rights and will improve the fiscal health of state and local governments. And public unions can go on politicking — just with the money of workers who actually want to be their members.