|Susan Hayward as Bathsheba|
As I say, this is a really weird film. It is in the film's third act when we flashback to Samuel's anointing of David as a shepherd boy and then to David's battle with Goliath. Of course, this means that we follow David as a young man (i.e. not Gregory Peck) at the end of the film rather than the film's star, Gregory Peck, whom we have been following for the movie's first ninety minutes.
|Despite this poster's promises, Gregory Peck wears a shirt at all times.|
But what David does at the end of the film is in fact defy the Mosaic law and go talk to the god directly. Once he does this – once he remembers the god – the god forgives him and it rains in Israel. What the film is saying is that laws against adultery aren't important (it has said that throughout the film). Each man must make the ethical choices that accord with his own beliefs. As long as the individual remembers the god, believes in him, pays homage to him, then his behavior is immaterial – or at least mostly immaterial. Even David's murder of Uriah the Hittite, Bathsheba's husband, is apparently forgiven by the rain that the god sends at the film's end.