There are several reasons why Shakespeare might have devoted so much time to the witches. The first is simply that they make a wonderful spectacle. Just like the antics of the rustics and mechanicals populating other Shakespearean tragedies, the witches provide an entertaining interlude and are often an audience favorite; actors, too, enjoy playing them.
Next, they foreshadow the end of the play. The tone of the scene is dark, ominous, and foreboding. Also, the detailed incantations make us realize the depths of evil of the witches themselves and of Macbeth in his association with them, especially as they list such ingredients as:
Nose of Turk and Tartar's lips,
Finger of birth-strangled babe
A final reason why the scene is so prolonged and significant is that it emphasizes the importance of the witches and their prophecies to the play. Rather than their simply being a minor plot device, in this scene they show an uncanny power and malign influence, suggesting the influence of the Devil in the world. Also, Macbeth's reaction to the apparitions suggest that his ambition has affected his sanity; we get a sense that delving too far into the supernatural or associating with witches will eventually drive people mad.
This is Shakespeare's way of showing us just how evil the witches are and what sort of trouble Macbeth is in for making deals with these women. They aren't doing Macbeth any favors...they are simply toying with him because he is an overly ambitious idiot of a human. They use him as a plaything.
We also know by their words that Macbeth's character has changed completely. The second witch announces his approach by saying, "By the pricking of my thumbs, something wicked this way comes."
The evil the witches are capable of is especially illustrated in some of the ingredients such as an Adder's forked tongue and the finger of a baby who was strangled at birth.
The rhythm of their chant is also helpful in creating an evil sing-song mood for the scene.
Shakespeare sets all this up and then allows Macbeth to come strolling in and demanding that these women show him what he's come to know. He's in no position to demand, but his ego is so overinflated by this time that he thinks he controls everything and everyone.
All of this helps build the suspense for the remainder of the play as well.