Lower realms rising?
If the man was a monk, he would eventually be expelled from the monastic order. Similarly, if the man's mind has been consumed by pornography to the  point his behaviour is contrary to social norms, he should probably be forbidden from entering the temple. Often, people with addictions cannot be helped, until those people can recognise for themselves they have a serious problems. 

The four brahma vihara (metta, karuna, mudita, upeka) include equanimity when we wish to help someone but are unable to. 

In short, the monks who are responsible for the temple should probably telephone the police to remove the deranged man from temple. Buddhism does not have the power to save everyone.