Banquo's ghost serves as an indicator of Macbeth's conscience returning to plague him for his murderous deeds. Banquo is the only one who knew of the witches' prophecies. In Act 3, Scene 1, he admits that he suspects foul play on Macbeth's part in King Duncan's death:
Thou hast it now: King, Cawdor, Glamis, all,
As the weird women promised, and I fear
Thou play'dst most foully for't:
For this reason, Macbeth had Banquo killed. Now, Banquo's ghost is a message to Macbeth. He is reminded of his horrible deeds in killing King Duncan and having his friend Banquo murdered as well.
Now, Banquo's ghost will not allow Macbeth to rest. He appears to stir up Macbeth's guilty conscience. He is a foil to Macbeth's character both alive and dead. He resisted the evilness of the witches' prophecies while Macbeth succumbed to it. Now, Macbeth sees Banquo's ghost. He is reminded of his murderous deeds. Banquo will not go away and allow Macbeth to enjoy his new position as king of Scotland.