On the Origin of Mating Behavior in Spiders