You don't. Nature doesn't work that way. We don't get to choose. What you can do is plant onions, garlic, chives, bee balm, lemon balm, marigolds, lemongrass, parsley which naturally repel many typical garden bugs. There are others, just Google companion planting or plants that repel bugs.
The spiders may also help in disposing of the little bugs you don't want on your plants. They tend to go where their food is available close by.
SPIDERS help keep the bug population down. They like aphids, crickets, beetles, etc that harm plants. You should welcome them. Vinegar keeps them outa your house but they're vital to the plant life.
Learn to tolerate them. They actually like people!
Plant mint varieties in pots around the areas you don’t want spiders. I say pots, because mint family plants will send out runners and spread wildly. But I also agree that spiders (in the right places—NOT in my house!) are very valuable.