The role of the witches in William Shakespeare's Macbeth is three-fold. First, the witches part in the play is included given Shakespeare's desire to please King James. King James' curiosity regarding the supernatural led Shakespeare to include a supernatural (or three) elements in the play. Second, the characterization of the witches is also included in order to parallel the characterization of Macbeth. Third, the inclusion of the witches support the tone of the play.
The parallel of the witches to Macbeth is included in order to show Macbeth as an evil character. Led by his ambition, Macbeth is willing to do anything to possess and keep the throne. First murdering Duncan, Macbeth continues to spill more and more blood upon the land. Essentially, the relationship between Macbeth and the witches illuminate the idea of the paradox, which resonates throughout the play. The famous line, "foul is fair, and fair is foul," resonates time and time again over the course of the play. Proving that not all things are as they seem, the witches prove to be far less wicked and evil than Macbeth (shown to be quite good in the opening).
Lastly, the inclusion of the witches illuminate the dark and ominous tone of the play. Given the witches occupy the opening scene of the play, they set the tone for the remainder of the action. From this scene out, much of the action is both dark (the multiple murders and insanity) and ominous (the inclusion of the witches and the apparitions).
The witches in Macbeth are there to confuse Macbeth. They give him prophecies which touch his hidden desires for power and wealth. As the play goes on, they keep on encouraging his lust for power, and so Macbeth kills many people in his quest for the retention of absolute supremacy. Macbeth has blind faith in the witches' prophecies (that no man born of a woman shall kill him, that he shall never be conquered until Birnham Wood comes to Dunsinane Hill, etc.), and so he believes he is invincible. However, Macduff, a man who has been untimely ripped from his mother's womb (that is, delivered via C-Section) kills Macbeth, and Malcolm has his army camoflauge themselves as trees when they go to fight against Macbeth, fulfilling the witches' prophecy that when Birnham Wood comes to Dunsinane Hill, Macbeth will be killed. Ultimately, the witches confuse Macbeth ("Fair is foul, and foul is fair") and set him up for destruction. And, as you can see, Macbeth is very easy prey - he plays straight into their hands and allows himself to become corrupted by their enticing prophecies.