I'm going to answer from the view of a parent or a religious leader. Sex is supposed to be beautiful, but we live in a world where sex hurts people, brings diseases, etc etc. Parents would probably view it as dirty because they want to protect their children from sex at too early an age. Some parents may present sex as dirty and immoral to make sex less appealing and tell them sex is only pure and acceptable through marriage (SOME parents, not all). Religiously, in most cases sex is considered fornication because people outside of marriage have sex. Not only that, but people's fantasies and the passion tied in with sex...not things you'd see in a church (not supposed to anyway). Plus there's adultery which is usually the result of sex out of marriage, not with your spouse. Then not to mention that people are not careful and all these sexually transmitted diseases are everywhere.
I hope that gives you a little view of why anyone would refer to sex as dirty.
I hope that gives you a little view of why anyone would refer to sex as dirty.