Asking if sexual dreams are sinful can be a pretty awkward question.
Thankfully, and perhaps to your surprise, St. Thomas Aquinas answers this question in Summa Theologiae. He says that wet dreams are not sinful.
That’s right, a thirteenth-century theologian tackled this problem long before any psychologist or therapist, but St. Thomas’ reasoning has nothing to do with condoning any kind of sexual sin. His reasoning has to do with … well, reason; because in order for us to be guilty of a sin we need to have the chance to suppress the thought of committing it with our reason.
In the absence of reasonable judgment, St. Thomas says, there is no sin. Since a person does not have legitimate access to his intellect during a dream, sexual dreams are not sinful.
However, other factors may contribute to our having that dream in the first place, such as racy TV shows. These, Matt Fradd emphasizes, we should avoid since they would qualify as a near occasion of sin.