There are a couple of ways to approach your question. The simplest answer as to why one character does anything in a film (or a play, for that matter) is that the director or actor decided that it suited the moment. You must remember that plays and films are written to be staged/filmed by someone other than the writer. Those who produce the play/film provide many of the choices as to action. Which is what makes a play or movie different from, say, a novel. The playwright or screenwriter doesn't create the whole event.
There are a few observations to make about the film version that you saw (though you don't say which version it was) and its choice to have Kate slap Petruchio during the wedding. First, the wedding itself is not shown in the play that Shakespeare wrote, only described by Gremio. And if we are to believe him, Kate was not the wild and raucous one, Petruchio was:
Tut, she's a lamb, a dove, a fool to him!
...when the priest
should ask if Katherine should be his wife
...The mad-brained bridegroom took him such a cuff
That down fell priest and book, and book and priest.
And when asked what Katherine did during all this, Gremio says: "Trembled and shook." She doesn't seem to be the one in the mood to hit someone during the wedding that Shakespeare describes, rather, Petruchio does.
Later, when Petruchio tries to make her leave before she has enjoyed her wedding reception, she does become the Shrew that we know and love, and quite possibly, in her frustration and anger, strikes Petruchio. But this action would have to be determined by those staging the play, it isn't something we have support for in the text.