Google has quite an intelligent algorithm do rank websites. Other than using keywords it takes the internet linking structure into account to determine which sites are more relevent. This always seemed quite sensible since sites that are referred to a lot obviously interest more people.
However, since the web is becoming more and more collaborative through wikis, blogs and forums, people have found intricate ways to link to their site. Deep into their sites that seem interesting at first, they link further through to porn sites. Obviously, this is their intent since their porn sites become more relevant to Google through this mechanism.
Take notice of this and prevent such spam from polluting the community! You can read more in Steven's post.