What's happening is the workers are trying to harvest the food the spider is guarding, and get snatched away by the spiders as they try to collect the food.
Send soldiers in first. If you set the soldiers to disable food gather they'll go straight for the spider and kill it. You'll lose a few soldiers but the spider will be killed much more efficiently.