"Breaking the law can never be justified. The laws are changed due to the action that broke the law."
Right....unless there is a legal excuse or justification.
Legal excuses recognize the conduct of the defendant as undesirable/wrong but excuse the person from criminal liability.
Legal justification recognizes that a greater harm was prevented by breaking the law than would be averted by following the law.
Legal excuse = a woman kills a police officer who pulls her over. She legitimately thought that martians came to earth and are occupying the form of police officers and that they are bent on extermination of the human race. The act, killing a police officer, is wrong and abhorrent. That being said, she will be excused from criminal liability because she did not understand what she was doing (will be sent to a mental institution instead).
Legal justification = you are driving down the road. Right in front of you, a motorcyclist falls off his bike. You have no time to stop. You swerve into the other lane (which is empty and you can see that no cars are coming for 40 miles) to avoid running over and killing the motorcyclist. While you broke the law (drove in the wrong lane), you did so to avoid a greater harm (killing the biker) and thus will be justified (and will not have charges pressed).