In many countries there are constitutional principles to prevent arbitrary pardon. If a law was unjust all prisoners are freed.