Law reflects morality. Moral decisions are personal; legal decisions are social -- everyone agrees that murder, for example, is immoral and illegal. However, many topics find their way into grey areas, what some individuals would deem inappropriate morals, others would deem acceptable. Enacting laws that enforce one morality over another is laying the foundation for social strife. One group's morals cannot predominate over another. In as much as a proponent's morals are enacted into law, so opponents would view that law as immoral and unjust, and would disregard it.
Thoreau, in his Civil Disobedience, makes the case, for example, that taxes, although legal, are immoral. In his time, his tax money went to fund an army to conquer land from Mexico. He stopped paying his taxes in protest. "I become a majority of one," he wrote.
Each individual must determine his or her own morality, and from that, determine what law is acceptable. A culture therefore is the most vibrant when laws are in place to safeguard rights, and not to dictate a code of behavior or ethics. When that occurs, and the law is unjust in one's judgement, one is not bound.
Curiously, the US judicial branch included the concept of a jury law review -- if someone "broke the law" and could make the case that they did so for good reasons, the jury could not only determine guilt or innocence, but could state that even if a defendant had violated the law, the law itself was wrong and could be stricken from the books -- in other words, the defendant was innocent the law was wrong, and the offending law could be nullified. The legal thinking behind that process was that the legislative branch may have enacted a law; it was composed of a random group of representatives; the jury could nullify the law, as it was composed of a random group of jurors.
Had the original system of checks and balances remained in place, there would be fewer unjust laws; in fact, there would be fewer laws overall, and the laws remaining in place would be that much more justified, as everyone would clearly see the benefit to adhering to them. Good law enhances good law; bad law undermines all law.
I am certainly no advocate of unjust laws. Yet, I'm not sure if I'd go so far as to say that an unjust law is no law at all.
Some laws are so unjust that it is justifiable to disobey them and even to rebel against the government that has established them. This is how the United States of America came into being, how India gained its independence from Great Britain, and how African-Americans gained their civil rights.
There are other laws, however, that might not be fair, but still deserve to be followed. For example, many people think that the structure of taxes in the United States is unfair. Some say that taxes on the rich are too low, while others believe in the "flat tax," by which everyone would pay the same percentage of their incomes. Does this mean that all those who think the tax structure is unfair should stop paying their taxes? Or that each person pay only the amount of taxes that he or she thinks is justified? The government (that is, the collective community) would soon be bankrupt (it might be already, but that's a different discussion). Roads would fall into disrepair; bridges would collapse; support for the poor and temporarily unemployed would cease; the military would crumble, leaving the country vulnerable to foreign invasion, police protection would end and chaos would emerge, etc, etc.
In this example, as in others, I think we must conclude that an unjust law is still a law.
The statement means that justice and the law could be two separate concepts. The latter has to embrace the fundamental support of the former. When it does not, individuals will feel the need to rebel against this legal structure, causing a lack of faith in any and all laws. A great example of this would be the moments in history when individuals have rebelled against legal edicts that have gone against a higher sense of justice. For instance, take the social movements against segregation laws in the American South and legal practices of discrimination of the North. These were moments in time when individuals felt that the law, as constructed, was unjust and denied the truer embrace of justice. Active movements which preached both violence and nonviolence was the result.
We can also find a version of this quote from William Lloyd Garrison, an early 1800's abolitionist who famously said in the first edition of his newspaper The Liberator, "That which is not just, is not law".
He was referring to the Fugitive Slave Act, which required northern citizens in free states to aid in the recapture of runaway slaves, and required their return to their owners. So the idea of civil disobedience in this manner has been around for a very long time, and is based on the same philosophy as Thoreau, Martin Luther King, and Gandhi.
Of course, this is a figurative statement and not a literal one. There are (depending on your beliefs) many unjust laws that are on the books and that are enforced.
This is a statement made by St. Augustine, and quoted by Martin Luther King, Jr. in his "Letter from Birmingham Jail."
What it means is that there is such a thing as a higher law. There is a set of ideals that all people should try to follow and a set of rights that all people have, regardless of whether their governments give them those things.
The quote is saying is that an unjust law is not legitimate -- there is no moral reason that you should have to follow that law. Because of this, it is a moral basis for the idea of civil disobedience that King and others followed.