Spiders' legs curl up is because a spider uses hydraulic pressure to push liquid into it's legs that allow it to move, and when it dies the liquid drains out making the legs curl up
If you've ever killed a spider (without completely squishing it) or come across one that is already dead, you know that their legs curl up beneath them when they die. You may be too busy being grossed out by this eight-legged creature to wonder just why this is. Human's limbs don't curl inward after they die. So what is going on with this posthumous tendency.
It turns out that spiders' legs are hydraulic. Or more specifically, two of the six joints in their legs are hydraulic. In order to straighten these joints and subsequently their legs, spiders flex their muscles and increase the pressure. When the spider dies, it obviously loses control over it's leg system and relaxes. The legs then curl upward automatically because no pressure is keeping them straightened.