No, they are not a sign of a spiritual attack. Some religions do frown upon any type of sexual activity outside of the marriage bed. This includes wet dreams and masturbation. The religions that teach the above are not speaking with sound medical evidence.