If a law is "bad" there are essentially two ways to overturn it. One is to go through the legislative body and have it amended. This is difficult and time consuming, and hard for one person to do.
The other way is to go to court, and argue that the law is bad. But about the only way to do that is to break the law. This is where civil disobedience comes in. It isn't a get out of jail free card, it is an opportunity to overthrow the law. If course, if you lose, you can go to jail.