In what ways can the concept of justice differ from mere legality in the context of lawmaking?

The CJI’s statement that legality alone does not make a law just makes me think about the deeper values and principles that should guide the creation of laws beyond just following procedures.