But the Court of Appeal also says a previous ruling went too far when it ordered the Alberta Union of Public Employees to stop supporting the guards and send them back to work.
The Appeal Court says that was an unjustified restriction on the union's freedom of expression.
In April 2013, several guards walked off the job over safety concerns at Edmonton's new remand centre and were soon joined by guards at several other jails.
Union leadership publicly supported the guards, even after the Labour Relations Board ordered the union to tell its members to return to the job.
The union was also assessed fines that reached $350,000 a day.