JAKARTA, Indonesia — Steven Handoko admits it wasn’t his most dignified moment. Naked as the day he was born, the bookish 25-year-old had been invited on stage by one of the strippers hired for a party at the Atlantis Gym.

That hardly qualified as outrageous behavior in the red-light district of Kelapa Gading in North Jakarta, where the Atlantis was located. Nearby were plenty of venues with suggestive names like the Playboy Sensation, massage parlors for straight men. The Atlantis was a gay sauna in a conservative country, but given the generally live-and-let-live milieu of the Indonesian capital’s night life, Mr. Handoko felt safe, if a little embarrassed.

But he wasn’t. Soon after he took the stage, the police stormed the premises. Officers herded naked, cowering men into the middle of the room and began taking photos, some of which — including one of Mr. Handoko — appeared on Indonesian social media within hours. He and 140 other men were taken away.

“When a future employer Googles me, this is what they will see,” Mr. Handoko, an aspiring journalist, said last week in an interview at Cipinang prison in Jakarta, where he has been held since the raid in May.