It's illegal for cops to strike, so instead they get "blue flu". It was illegal for the air traffic controllers to strike. They did anyway, so Reagan fired all the strikers.
What would be more effective would be to make firing mandatory for striking government employees
What would be most effective would be to make it illegal for a governmental employer to withhold union dues. If the unions had to collect dues from each member, they would be much less powerful