The first reason is that Macbeth has just risked his life to fight and win two battles for the King, against the "merciless Macdonwald" and against Norwegian forces (Act I, Scene 2). If Macbeth had been entertaining a plan against the king, it would have seemed more logical for him to join forces with the king's enemies rather than destroy them.
The second reason is that the King has just rewarded Macbeth, promoting him to Thane of Cawdor (Act I, Scene 2). He has also made a public promise to benefit Macbeth in unspecified ways in the future (Act I, Scene 4). Thus the king does not need to fear that Macbeth might feel his efforts and sacrifices have gone unnoticed and unrewarded.
The third reason is that Macbeth is not the direct heir to the Scottish throne, so it does not at once seem obvious that he will become king if Duncan is killed. Duncan has appointed his own son Prince of Cumberland, that is, heir-apparent to the Scottish throne, and thus Duncan's presumed successor at death (Act I, Scene 4).
The fourth reason is that Duncan has been a much-loved king, and there is no reason for anyone to wish him dead or support a rebellion against him. As Macbeth himself realizes in Act I, Scene 7, Duncan's murder will be a difficult action to justify, since he is shielded by universal public acclaim:
Besides, this Duncan
Hath borne his faculties so meek, hath been
So clear in his great office, that his virtues
Will plead like angels trumpet-tongued against
The deep damnation of his taking-off,
And pity, like a naked new-born babe,
Striding the blast, or heaven's cherubin horsed
Upon the sightless couriers of the air,
Shall blow the horrid deed in every eye,
That tears shall drown the wind.
The four reasons that the king doesn't feel he has anything to fear from staying overnight in Macbeth's castle are thus as follows:
- Macbeth has just fought in the king's defense.
- The king has just rewarded Macbeth.
- Macbeth is not the king's immediate successor to the throne.
- The king is widely loved and supported, making his murder seem impractical.