Sleep is a prevailing motif in Macbeth. Shakespeare uses it throughout the play to show the guilty consciences of Macbeth and Lady Macbeth. At the beginning of the play, after the murder of Duncan, it is Macbeth who is filled with remorse and guilt. He is immediately sorry that he committed the act and cries,
Macbeth has murdered sleep.
Macbeth shall sleep no more.
Yet, Lady Macbeth feels no guilt, no remorse. She assures her husband that "a little water clears us of this deed." She is, unlike Macbeth, thrilled with the anticipation of how their lives will change as a result of killing Duncan.
Throughout the play, Macbeth is troubled with being unable to sleep. Lady Macbeth refers to his bad dreams, and his sleepless nights:
You lack the season of all natures, sleep.
So, it is fitting that when Shakespeare shows Lady Macbeth's collapse in Act 5 that she displays her delayed feelings of regret and guilt through sleepwalking--which signifies a very troubled sleep. As Lady Macbeth sleepwalks, she references many of the misdeeds committed by her husband and especially the murder of Duncan that she had planned. Her sleep in a way was "murdered" too, and the only way for her to regain the peace she once had is to die.
In the play, Shakespeare explores the psychological consequences of committing immoral acts for personal gain. He shows the devastating effects of a guilty conscience through the inability to sleep peacefully.
In my mind, the purpose of the sleepwalking scene is to reflect a level of change within Lady Macbeth. From being seen as a source or origin of evil intent and actions, confident and assured that what was done was needed to be done, and from one who was driven by her "function not being smothered by surmise," Shakespeare intends to create an individual who has been crushed under the weight of evil. The idea of sleepwalking itself reflects an unnatural state. In making her sleepwalk, we can see a couple of things. One of these is that the most natural and peace-like state of slumber is distorted. This might help to reflect Lady Macbeth's own recognition that what was done in the name of ambition is unholy and unnatural. Additionally, it is an indication that Lady Macbeth is coming "unglued." When captured sleepwalking, it helps to bring out the idea that something is amiss in Lady Macbeth. Finally, I think that the domestic purpose of Lady Macbeth's sleepwalking might help to reflect the fundamental state of the marriage at the end of the drama. The notion of sleep between a husband and wife is fairly sacred and absolute. Yet, in seeing her sleepwalk, this notion is disrupted, reflecting the bond between husband and wife is also disturbed, past a point of being fixed without drastic acknowledgement and recognition.