This is a bit of a Game Freak logic question, but I think there are some genuine explanations, so I'm answering it anyway.
The most straightforward answer is that most spiders are nocturnal, which while it is a bit of flawed logic, other nocturnal Pokemon also get Insomnia (such as Hoothoot and Murkrow), so GF seems to think it's a good enough reason.
However, a cursory search led me to find that spiders don't actually sleep in the same way that humans do. Instead, they go into a resting state called quiescence. This still helps save energy, but it's more like a half-sleep. Species of spiders that hibernate also use this during winter.
Source