Windows 7 is setup to automatically do a lot of stuff by default. While nice for the average user, it can sometimes be really annoying. I stopped using sleep mode on my HTPC because it likes to wake itself up to perform tasks in the middle of the night. Maybe one day I'll turn off all those midnight tasks so my computer stays sleeping instead of having to power it down.
Check your task scheduler and see what is happening in the middle of the night. I wouldn't be surprised if Windows Update went off and rebooted your computer.