Educate people about the importance of privacy and respect. When people understand that these types of stories are not okay to share, they are less likely to spread them. Also, in social media or online platforms, report any such inappropriate content.
One way is to simply walk away from any conversation that starts to head in that direction. If you are in a group and someone starts to share such inappropriate stories, change the topic or leave the group.
Set clear boundaries in conversations. Let others know that you are not interested in hearing such stories. And in general, promote positive and respectful conversations about the gay community that focus on things like their contributions to society, their art, and their culture rather than inappropriate sexual stories.