Lennox is a young man. He is a little nervous, finding himself alone with the older and socially superior Macbeth, who is strangely silent and grim. Lennox feels he has to talk about something, so he talks about what most people talk about in awkward situations: he talks about the weather.
Shakespeare wanted Macbeth to be present when Duncan's body was discovered. He wanted Macduff to be the one who discovers the body, since this will be the only time Macduff and Macbeth appear together before their death duel in Act 5. The knocking at the gate forced Macbeth to do what he had wanted to avoid. He had wanted to pretend to be asleep when the body was discovered and the hue and cry erupted. He is acting very strangely because he dreads the discovery of Duncan's body. Lennox, being young and innocent, has no suspicions.
In order for Macduff to discover the body, he had to be the one appointed to wake the king. But why have Macduff perform that duty when he is sleeping outside the castle? Shakespeare wants him to be outside the castle because he wants him to be the one who knocks at the gate and thereby forces Macbeth to put in an appearance to find out why no one is opening it. Macduff had to spend a very bad night. He is a high-ranking thane, and Shakespeare has to explain why he was not accommodated inside the castle. In Act 2, Scene 1, Banquoand Macbeth have the following exchange:
What, sir, not yet at rest? The King's a-bed.
He hath been in unusual pleasure and
Sent forth great largess to your offices:
This diamond he greets your wife withal,
By the name of most kind hostess, and shut up
In measureless content.
Our will became the servant to defect,
Which else should free have wrought.
Macbeth's reply is intended to explain why Macduff did not spend the night inside the castle. They were unprepared to receive so many guests. When Banquo says the King has "Sent forth great largess to your offices," this is intended to explain why the entire staff is so drunk that nobody is awake to open the gate when Macduff arrives. The "great largess" included a lot of liquor.
Lennox's speech in Act 2, Scene 3, is largely intended to fill up time. The two men can't just stand there without saying anything. Lennox's speech serves to emphasize his youth and innocence; to make Macbeth seem old, weary, anxious, guilty, and apprehensive by contrast; and to enhance the already tense and ominous mood by his description of "lamentings," "strange screams of death," "accents terrible," etc. It is like a prelude to Macduff's return from the King's chamber saying:
O horror, horror, horror --
Tongue nor heart cannot conceive nor name thee!
Here is what Macbeth has been dreading, what he had hoped to avoid by pretending to be asleep in his chamber. Lennox's speech might be termed a kind of "foreshadowing," since the audience knows what is going to happen very soon and is dreading it along with Macbeth. The scene he has wanted to avoid is played out at full length. Macduff rings the alarm bell and summons all the important members of the cast. Macbeth just has to stand there and endure the shock which all the innocent guests receive as they come rushing in from all sides dressed in their white nightgowns like ghosts. Macbeth expresses his mixed feelings of guilt, shame, remorse, and despair when he says to himself:
Had I but died an hour before this chance,
I had lived a blessed time; for from this instant
There's nothing serious in mortality:
All is but toys; renown and grace is dead;
The wine of life is drawn, and the mere lees
Is left this vault to brag of.