Are those not legal definitions? Legality and justice are not necessarily synomymous.
A guilty person going free is not justice.
An innocent person being convicted of a crime he did not commit and going to prison is not justice.
Shall we go on?