The character of Lockwood narrates the novel to us and serves as mediator of all that he hears from Nelly Dean. His narration therefore frames the narration of Nelly Dean (whose narration in turn frames other narrators, such as Isabella). Therefore one of his functions is to distance us from the narration through a series of framing narratives - a key gothic technique to confuse narration.
Secondly, we need to consider the character of Lockwood himself. He is an outsider (in some ways worthy of comparison with Heathcliffe) and as a cultured town-loving person, is completely at sea in his new environment. He doesn't understand the way they do things in Yorkshire and is something of an unreliable narrator. We can see this in the wy that he thinks Heathcliffe is a "capital fellow" and then later foolishly begins to flirt with the idea of a relationship with the younger Catherine. Therefore Lockwood helps emphasise the way in which social conventions have been disregarded in the world of this novel.
Lastly, he is the victim of the dream/nightmare of Catherine, and his action in rubbing the ghost's wrist across broken glass foreshadows and introduces the theme of violence that runs throughout the book. Even though he is an outsider, he shows the violence inherent within him under pressurised situations.