You would have to use some kind of machine learning technique to get a program to differentiate between a porn file and a non-porn file. It would probably take a massive amount of computing power. It would need to analyze audio and video. It'd have to detect nude bodies engaging in intercourse. And even then it might get confused with different kinds of porn.
1st step: you would need a botnet. It would have to be very reliable with thousands if not millions of nodes.
2nd step: The combined resources from the botnet would need to be used for recon. At this phase the program needs to analyze a particularly large dataset of porn videos and pictures. This is where the program "learns" what porn is.
3rd step: Testing. The program must be tested against a large database of porn. It should successfully identify porn videos and images within a reasonable margin of error.
4th step: All you have so far is a program that identifies porn. You now need to write a worm that can infect multiple platforms. You have to research different points of entry and exploits.
5th step: Testing. Test your points of entry/exploits. Test against different virus scanners.
6th step: Strengthen malware against defenses using knowledge from step 5.
7th step: Deployment.
All in all this would take years to develop. It would need a huge team and lots of money. This is on the same scale as stuxnet. It will never happen.