In Shakespeare's Macbeth, after he assassinates Duncan, Macbeth hears a voice that tells him he has murdered sleep. In delivering Duncan to the big sleep, as they say, to figurative sleep, to death, Macbeth himself will sleep no more.
Macbeth panics after he kills Duncan, feeling that he will never be able to get Duncan's blood off his own hands, and that if he were to wash his hands in the ocean, there is so much blood that it would turn the sea red. He is panicked and a bit out of control. When he hears the knocking on the door (Macduff, soon to be Macbeth's nemesis, has arrived, though Macbeth doesn't know who is knocking), he speaks the lines you ask about.
For the moment, Macbeth regrets killing Duncan, and wishes he were still alive so something like knocking could wake him. The first line is self-directed sarcasm: wake Duncan with your knocking! The second line is his expression of sorrow and regret: I wish knocking could wake him.
What Duncan will do forever, Macbeth doesn't do that night--sleep. And his sorrow and regret is short-lived. Moments later he kills the grooms, presumably to shut them up, then devises a quick, complex argument to explain away his doing so.
Later, however, Macbeth will wish he could have the peace Duncan has in death. And Duncan has something else Macbeth no longer has--the ability to sleep. Macbeth's closing lines in this scene contribute to and further the theme of insomnia in the play.
I interpret this to mean that Macbeth is feeling very guilty about the fact that he has killed King Duncan. We have seen this in a number of places already and this is one more bit of confirmation.
Before Macbeth killed Duncan, he had the vision of the bloody dagger. That was his conscience bothering him about what he was going to do. Then, after he killed Duncan, he could not manage to pray because he felt so guilty. Now, he is saying that he wishes that the knocking could wake Duncan up -- he wishes Duncan were not dead. This tells me that he feels guilty for his crime.