Some public-workers unions are experiencing steep losses of members and fees, dips largely triggered by a 2018 Supreme Court ruling that gave members an out.

The Washington Federation of State Employees lost fees from nearly 7,000 nonmembers after the ruling. Nearly 5,000 workers resigned their membership and stopped paying dues in the year that ended June 30, compared with the prior year, according to filings with the Labor Department.

The...