I'm sure those who defended them didn't think so.
So do I, but the way to fight unjust laws is to get them changed.
Hey, I know a few things about how these laws got "changed" For example, 55 years ago today, four teenaged girls were killed, and many more people injured, in a church bombing meant to express disapproval at the idea of anyone fighting that sort of "law".
BTW, it took decades before most of the people directly responsible to be "brought to justice". This was in large part because the police and legal system of the time (heh, "of the time") were eager to justify such laws. It often required intervention at the federal level to...correct such matters - and today's federal government is uninterested in such matters, instead preferring to cage children and applaud police violence based on skin color.
(Also, Birmingham presents something of an issue: white people at that segment of spacetime were mostly enraged about black people living among them, and demanded segregation. When black people left and built their own communities, the white people became enraged by
that, and turned violent. That's because the actual view was "If black people don't reflect their natural inferiority, then it's a crime against God himself and they must be punished through violence." The justifications were fig leafs.)
Don't we usually call that vigilantism?
It's rare to hear MLK Jr. being referred to as a "vigilante" these days. I have no doubt that you wouldn't do so, so you should check your logic, because that's where it leads to.