
The Porter provides the play's only sustained comic relief — and uses it to say something true. His hell-gate speech is a hinge between the murder and its discovery, offering release while simultaneously deepening the horror.
The Porter is the gatekeeper of Macbeth's castle, roused from his drunken sleep by the knocking at the gate that follows Duncan's murder. His scene is one of the most celebrated in Shakespeare — a sustained comic monologue in which he imagines himself as the porter of hell-gate, admitting a series of damned souls.
The comedy is darker than it appears. The castle he guards has just become the site of a king's murder, and his fantasy of presiding over hell is — in the logic of the play — entirely accurate. He is the porter of hell. He just doesn't know it.
He disappears after letting Macduff and Lennox in, never to appear again. His function is complete: he has provided the audience a moment to breathe before the discovery of the body, and he has named, in jest, exactly what the castle has become.
The Porter is motivated by nothing more than the desire to get through the night and collect his tip. He is the one character in the play entirely outside the political tragedy — which is precisely what gives him his strange clarity.
The Porter is drunk, crude, and accidentally profound. His jokes about equivocators and farmers land differently once you know the play — equivocation is Macbeth's central crime against himself, and the Porter has named it before Macbeth has fully committed to it.