Civil rights groups and sex workers are raising concerns over the government takedown of Rentboy.com, an escort service that largely catered to gay men. The investigation and prosecution, involving both the Departments of Homeland Security and Justice, ended with a fine and jail time for Jeffrey Hurant, the company’s former CEO, as well as the arrest of six current and former employees on prostitution charges.

Hurant defended the nature of his business in court, saying it allowed sex workers to work safely after laboring in deplorable conditions.

“I disagree with the law I violated. I am obliged to follow it,” he said. “My company mitigated many of the dangers of sex work.”

Jeffrey Hurant, center, speaks to reporters as he leaves Federal court, Wednesday, Aug. 2, 2017, in the Brooklyn borough of New York. Mary Altaffer / AP

U.S. District Judge Margo K. Brodie in Brooklyn, who sentenced Hurant, noted the positive letters she received on his behalf and said she was convinced Hurant started the site for a good purpose.

“The very thing that is illegal — there is no question it did a lot of good,” Brodie said as she announced Hurant's sentence and $7,500 fine. “Almost two decades of committing a crime. That can’t go unpunished.”

Questions have also been raised as to why Rentboy was singled out by Homeland Security for investigation while other similar online services catering to heterosexual customers remain operational.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

NBC News reached out to the Department of Homeland Security for comment and has not yet received a response.

Related: United Apologizes, Reverses Truvada Policy After HIV Activists Push Back

Five New York City council members from the LGBTQ community signed a letter in support of Hurant, arguing that “a harsh sentence will serve neither society nor the rehabilitation of Mr. Hurant," according to the Associated Press.

New York Democratic congressmen Jerrold Nadler and Sean Patrick Maloney wrote letters to Homeland Security and the Department of Justice asking whether the agencies had wasted time and resources on pursuing a victimless crime, the AP added.

“Websites like Rentboy allow people to screen buyers, which contributes to their safety,” Hayley Gorenberg, deputy legal director of Lamba Legal, a nonprofit dedicated to LGBTQ civil rights, told NBC News. “Targeting it for criminal prosecution is a loss of safety for people who are just trying to do their work, no matter how politically unpopular that work may be.”

Gorenberg added that LGBTQ people are more likely to engage in sex work due to a variety of factors and the criminalization of sex work has an acute impact on them.

“There are many reasons this disproportionately affects the LGBTQ community, including discrimination that starts very early for some people who are rejected by their families, bullied out of schools, and face discrimination while trying to get other jobs,” she said.

Gorenberg noted that the stigma associated with sex work, particularly for LGBTQ people, could have been a contributing factor to Rentboy being singled out for prosecution.

“We all have a stake in how federal resources are being used to truly make us safer and more secure,” she said. “I can’t get inside anyone’s head, but we have certainly questioned why [the Department] would prioritize doing this.”

Sex worker rights advocate Kate D’Admo said that shuttering Rentboy only exacerbates the risks and dangers sex workers face every day.

“Folks are going to go to other websites where they have less control over things,” she said. “You’re going to get street-based things. You’re going to resort to other ways to make ends meet. This really did end up marginalizing a lot of individuals very abruptly.”

Follow NBC Out on Twitter, Facebook and Instagram