There are different theories as to why scorpions glow when exposed to a black-light. It could just be an accidental product of evolution. Alternatively, it could help attract prey. Other species can see different wavelengths of light to humans, and a glow might give them the urge to investigate the light source, giving the scorpion a chance to attack.
The most likely theory is that they use this UV glow to help find shelter during the night. Being out in the open makes them vulnerable to predators, so being able to find a hideaway is their best survival tactic. The UV light from the moon and stars gives a scorpion a slight glow, and the animal uses this to determine how safe an area is. When the scorpion finds itself in the shade, the glow from the overhead light is reduced.
Being able to detect any object that casts a shadow on the scorpion’s body helps it hide from predators. Using their entire body to detect where hiding places are they increase their chances of survival. Scorpions have even been found to rest in the shadow of a single blade of grass, which demonstrates how acute this sense has become.
Image from flickr.com/photos/furryscalyman