Just regarding the question if having an erection alone is considered sinful, the Rambam in his Mishnah Torah Hlichos Talmud Torah Perek 6 lists 24 things for which a person gets "nidui" (a specific type of excommunication). Number 21 is "One who intentionally causes himself to have an erection".