my opinion it has to do with the fact that you just strenuously exercised the muscles in your legs and with going to bed right after you didn't give your muscles proper time to relax with a good stretching period after your workout. they are probably cramping and tightening up. i would suggest you try to hydrate before during and after your workout and give yourself a good 10 minute stretching cool down before heading to bed.
what causes a searing moving pain throughout my thighs and calfs when sleeping. it's after an hour on the eliptical. i have chronic leg cramps overnight especially in my right foot where i have hardware from a broken ankle. occasionally the cramps turn into a searing moving pain that travels through the muscles making it impossible to stand and walk the cramps out. it must be from dehydration after exercise although i do drink powerade zero throughout my workout and at least 15oz of water at night.