Sam's sword can easily be seen in his scabbard during the fight, however instead of drawing it he decides to kick Shelob and roll on the ground reaching for Sting.
Sam was busy, rolling.
The exact reason is unclear. Sam could certainly have pulled his own sword before instead of reaching for Sting, however in the moment he would've been without fingertip reach of it, and it had already shown its prowess in cutting Shelob's webs as well as causing Shelob pain. Furthermore, as soon as Sting is tossed out of reach, Sam immediately begins to roll back and forth to dodge Shelob's stinger. There wouldn't have been much time in this manoeuvre to pull his sword out. At the end of the rolling, he ends up on top of Sting anyways. I've provided the scene below.
In the books
Things play out slightly differently in the books, Sam is with Frodo in Shelob's Lair, and when trying to cut through the web's with his sword, he finds he can do but little. Sting on the other hand cuts through the webs like a "scythe through grass"
In a fury he hewed at them with his sword, but the thread that he struck did not break. It gave a little and then sprang back like a plucked bowstring, turning the blade and tossing up both sword and arm. Three times Sam struck with all his force, and at last one single cord of all the countless cords snapped and twisted, curling and whipping through the air. One end of it lashed Sam’s hand, and he cried out in pain, starting back and drawing his hand across his mouth.
Then Frodo stepped up to the great grey net, and hewed it with a wide sweeping stroke, drawing the bitter edge swiftly across a ladder of close-strung cords, and at once springing away.
The Two Towers - Book Four, Chapter 9: Shelob's Lair
We then see that Master Samwise picks up the sword, but never drops it, and it is in fact the combination of Shelob impaling herself on Sting and the Light of Galadriel that causes Shelob to flee in fear.
He sprang forward with a yell, and seized his master’s sword in his left hand. Then he charged.
... with a quick upthrust of his other hand stabbed at the clustered eyes upon her lowered head. One great eye went dark.
and so Shelob, with the driving force of her own cruel will, with strength greater than any warrior’s hand, thrust herself upon a bitter spike.
And Shelob cowed at last, shrunken in defeat, jerked and quivered as she tried to hasten from him. She reached the hole, and squeezing down, leaving a trail of green-yellow slime, she slipped in, even as Sam hewed a last stroke at her dragging legs. Then he fell to the ground. The Two Towers - Book Four, Chapter 10: The Choices of Master Samwise
The script appears to suggest that the decision to have Sam drop Sting was a directorial choice on the day of filming. In the "Final revision" script Sam never drops Sting when he's thrown by Shelob.
ANGLE ON: SHELOB HISSES and REARS above SAM, her STINGER dribbling with VENOM!
SAM ducks inside the arch of her LEGS and STABS STING into one of her EYE CLUSTERS!
CLOSE ON: SHELOB SCREAMS, her MANDIBLES thrashing wildly, GREEN OOZE trickling from her WOUNDED EYE.
With HIND LEGS, SHELOB picks SAM off the ground and TOSSES him BACKWARDS! SAM lands heavily . . . and SHELOB POUNCES!
ANGLE ON: SHELOB heaves the great bag of her BELLY high above SAM'S HEAD. As she splays her legs to drive her huge bulk down on him, SAM lifts the ELVEN BLADE above his head, holding it with TWO HANDS.
STING slides into SHELOB'S SOFT UNDERBELLY! A SHUDDER runs through her! HEAVING up. again, she wrenches herself away from the PAIN ... her LIMBS writhing beneath her.
Adding an extra sword into the mix would confuse viewers and require five (pointless) additional shots to be filmed; one where he pulls his own inferior sword, one where he wields it, one where he loses it, a shot showing him picking up Sting and another shot establishing that he's holding Sting now (and not his own sword).
This is a mistake in the movie
In the book Sam actually attacks Shelob with both swords; his own (in his right hand) and Sting (in his left).
All quotes from the Two Towers chapters, "Shelob's Lair" and "The Choices of Master Samwise".
First of all Sam drops his own sword during Gollum's earlier attack on him:
His long right arm shot out, and he grabbed Sam's wrist: his fingers were like a vice; slowly and relentlessly he bent the hand down and forward, till with a cry of pain Sam released the sword and it fell to the ground...
But then picks it up again and uses it to help drive off Gollum:
Sam swept up his sword from the ground and raised it. Gollum squealed...
After this he comes upon Frodo, after having being poisoned by Shelob, and picks up Frodo's sword:
He sprang forward with a yell, and seized his master's sword in his left hand. Then he charged.
And finally drops his own sword again for the last time when he stabbed Shelob from below:
For Sam still stood upon his feet, and dropping his own sword, with both hands he held the elven-blade point upwards...
So only the final blow was struck with Sting only in preference to his own sword.
As to why that happened, an obvious explanation is given earlier when Frodo and Sam try to get past one of Shelob's webs:
In a fury he hewed at them with his sword, but the thread that he struck did not break. It gave a little and then sprang back like a plucked bowstring, turning the blade and tossing up both sword and arm. Three times Sam struck with all his force, and at last one single cord of all the countless cords snapped and twisted, curling and whipping through the air.
By comparison, Sting was able to cut them:
"Let us see what Sting can do. It is an elven-blade. There were webs of horror in the dark ravines of Beleriand where it was forged." ... Then Frodo stepped up to the great grey net, and hewed it with a wide sweeping stroke, drawing the bitter edge swiftly across a ladder of close-strung cords, and at once springing away. The blue-gleaming blade shore through them like a scythe through grass, and they leaped and writhed and then hung loose. A great rent was made.
So Sam was already well aware that his own sword was mostly ineffective against Shelob's webs, whereas Sting was able to cut them with ease. He should then have easily been able to conclude that the same might apply to Shelob herself.