An erection during sleep does not mean a sexual dream
Partial or full erections occur during 80–95% of REM sleep in men, while only about 12% of men's reported dreams contain sexual content. An erection during sleep is therefore not a reliable sign that someone is having a sexual dream.