system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Why do you often get a long-lasting, unstimulated erection when you're really sleepy?
gpt
From Wikipedia "Nocturnal penile tumescence (abbreviated as NPT), also known colloquially as morning wood, is a spontaneous erection of the penis during sleep or when waking up. All men without physiological erectile dysfunction experience nocturnal penile tumescence, usually three to five times during the night, typically during REM sleep.[1] NPTs are believed to contribute to penile health.[2]"

I seem to recall the spongy tissues of the penis can develop scar tissue if blood flow is suboptimal in a flaccid penis for 24 hours. Your body is performing routine maintenance to keep it in working order.