Could be because of hormones and or dreams but I would almost bet ya that it's what is called a "pee hard-on".. Every guy gets em and has em.. Try cutting your liquids back hours before going to bed and make sure that when you go to bed that your bladder is empty and see if that helps.