They provide legal protection for rescuers. This law protects him from any wrong doing if he helps a person in distress.
They are meant to encourage responsible people to offer aid to accident victims. Since it protects them against any legal action, it lessens their fear to help someone in peril.