Well, yeah, but as Freud is supposed to have said, 'Sometimes a cigar is just a cigar.'...
One could see phallic symbolism in Sam using a sword to pierce Shelob, but in that world what other kind of weapon would he use? A spear, an arrow? In other words, there are very few ways that Sam could have seen off Shelob that couldn't be interpreted 'sexually'. I suppose he could have tried setting her on fire...
Shelob is a force of
evil & as Rosebury has pointed out it is necessary that evil be shown to carry the seeds of its own destruction - it is not an equal & opposite force to good, but rather a perversion of it without the power to sustain itself.
Perhaps Freud has gotten us all seeing things which aren't always there.
Or to put it another way, sometimes stabbing a giant spider is just stabbing a giant spider...