The cause of NPT is not known with certainty. Bancroft (2005) hypothesizes that the noradrenergic neurons of the locus ceruleus are inhibitory to penile erection, and that the cessation of their discharge that occurs during REM sleep may allow testosterone-related excitatory actions to manifest as NPT.
I'm erect and I fap in the morning if I was fapping just before bed, or talking dirty on the phone the night before. I guess if the last thing I think about before bed is sexy stuff, then my mind meditates that (along with constant nightmares) and that's what I blame for morning wood. I don't usually get it, though.