John Proctor's death at the end of the play is legal but unjust. As pointed out in the second post, this idea is certainly central to the message of the play.
Law and justice would coincide were reason to rule over emotion, but this is not the case here. The fact that the ruling emotions were fear and false righteousness and greed serve to further divide the prevailing legal rule from any sense of justice.
Everyone in Salem, it seems, is touched by the unjust application of the law in this play. Some, like the Putnams, benefit unfairly as the land of those who are convicted as witches becomes available. Others, like the last three to hang, suffer and even die because of the stubbornness and arrogance of people like Danforth and Parris. No one escapes.
This play absolutely shows this idea. Everything that the court does in this play is legal, but just about everything it does is also unjust. When laws are made based on ignorance or fear, they can certainly be unjust.
To take an example from relatively recent times, segregation laws were created out of ignorance and perhaps some fear. They were based on ignorant ideas of white supremacy. Even so, they were legal. Clearly, in that context, the law was not just. The same is going on in The Crucible.
It's also true that the law can be used in unjust ways. In the play, for example, people (like Abigail) are using the law in ways that are legal but for bad purposes. She is, to some extent, using the law to try to get back at the Proctors, not to promote justice. So it is possible to have unjust laws, but it is also possible to use laws for unjust purposes such as revenge or personal gain.