The best answer is gbeaty's excellent first response. The battle of wits is also an elaborate mating ritual. Some of Shakespeare's best matched lovers are the sharpest tongued enemies at the beginning of the plays. As each one tries to get the upper hand intellectually, we are given a glimpse of what falling in love is like. It is not all hearts and flowers; rather, it is confusion, anger, frustration and miscommunication, and fire, glorious fire.
Shakespeare lifted the Greek playwright's application of fast dialogue to fighting or war scenes and applied that technique to many of his love scenes. As far as I know, he was the first playwright to do this. The technique builds the tension between the characters and forces the audience to pay more attention to what goes on between them. It also makes our own hearts beat faster, along with theirs. The puns are a war of words and we are drawn into the battle, and, recognizing something of ourselves in it, we laugh.
A good and fun question.
There are several purposes to these puns /word plays. First and most simply, it is fun to watch. It is entertaining to see and hear such verbal facility.
Second, yes, you are right. One purpose is Petruchio taming Kate. Misunderstanding her (for comic effect) opens the door to many of his small victories.
Third, it is a way to establish new and in some ways private communication. They flirt this way—or he pretends they do—and he takes her comments as sexual. Think of that wonderful line, " What, with my tongue in your tail?" He turns her innocent comment into a pretty raw sexual one, letting her know the nature of their relationship (and giving the audience a laugh).
Fourth, and related to all of these, it shows they are in synch. They are meant to be together; this is marked by how they communicate.