“Moral responsibility” is the point where we need to apply correction (or praise when someone is responsible for doing something good).
Suppose a car drives through an intersection and injures a pedestrian. A police detective will investigate to determine all of the direct relevant causes that contributed to the accident. She may discover that the pedestrian was texting on his iPhone and walked into traffic. Or she may discover that the driver of the car was intoxicated. Or it may turn out that the traffic light was out of order and giving both the driver and the pedestrian a green light to go ahead. In some cases there may be more than one direct relevant cause.
If the traffic light is broken then we send out someone to repair it. If this happens frequently then we may want to install some kind of monitoring system that alerts us when a traffic light has a mechanical failure.
Texting while walking has been the subject of new safety education programs and even some local ordinances according to news reports. Such programs and rules are designed to correct this risky behavior choice. And they come from our own sense of moral responsibility to make things better in our community.
Drunk driving laws are now commonplace due to efforts by groups like Mothers Against Drunk Driving. MADD also appealed to our moral responsibility for the safety of our children and stirred in us a desire to change the laws. A judge can now apply progressively more severe penalties to repeat offenders that will either correct their behavior or keep them off the streets.
Rehabilitative penalties presume a person with free will. A person with free will autonomously chooses for themselves what they will do. Education, skills training, counseling, and post-release programs like Offender Aid and Restoration open up new and better possibilities for the prisoner upon release. The goal is a changed person, someone who will make appropriate choices of their own free will.
There is nothing supernatural or magical about this free will. It is quite ordinary. It is just us making our own choices for ourselves. There is no “freedom from causation” implied. After all, corrective penalties intend to cause different behavior in the future, so they require a world of reliable cause and effect.
That is how moral responsibility and free will operate within a deterministic universe.