I've killed hornets, red wasps, yellow jackets, etc... using Black Flag wasp and hornet killer--always dropped them in their tracks--but you had to hit them good. A little vapor or a few droplets just pissed them off.
I don't know of a sailboat that is not a spider haven as well. The rigging, lifelines, anchor rode, everything, seems to be perfect for them to weave a web. I did find some spider spray at Home Depot that killed them upon contact, and also found some spray called Spider Not that I sprayed the dock-lines with that kept them from migrating from using the lines as a bridge to the boat. They can, however, just wait for a slight breeze in the direction of the boat, shoot out a length of web and ride it to the boat.
I discovered the best time to nail the spiders is just after sundown, when they're coming out to build new webs to catch the evening meal. During the day they tend to hide anyplace they can find that out of the direct rays of the sun. Some of the best locations tend to be the bilge vents, uncapped openings at the ends of rails, and of course, the anchor locker openings. They also like to hide beneath the sail covers, the underside of rub rails and within the folds of roller-furled jib sail--locations where you would not dare use any kind of spray for fear of damaging the sail material.
One of the ways of keeping wasps and spiders out of the cabin is to cover the back side of the hatch vent(s) with screening. Granted, a few will eventually find their way inside, but the larger wolf spiders usually can make their way through the smaller cracks.