For the last few months, before he was sentenced for running what the government has called one of the largest sex work ventures ever prosecuted, Jeffrey Hurant has portrayed his former business, Rentboy.com, not only as a profitable online enterprise, but also as a kind of social service that conferred important benefits on the gay escorts who used it.

In court papers filed in Brooklyn, Mr. Hurant has pointed out that aside from making money — lots of money — Rentboy permitted prostitutes to move their trade from the streets to the safety of the internet and to work independently of pimps. The company ran Rentboy U, he said, which offered escorts classes in financial management and safe-sex practices. And, he added, it made large donations to the fight against AIDS and H.I.V., working at times with government agencies like the New York City Department of Health.

On Wednesday, a judge in Federal District Court in Brooklyn gave credence to his arguments, saying that while Mr. Hurant had broken the law, he had also done enormous good for the lesbian, gay, bisexual and transgender community. The judge, Margo K. Brodie, sentenced him to six months in prison, less than half of the maximum term the government recommended.

Mr. Hurant, 52, pleaded guilty in October to charges of promoting prostitution in connection with running Rentboy, which he founded in 1997 and stocked with escort profiles listing various sexual services and fees. According to federal prosecutors, the website received about 500,000 unique visitors a day and charged up to $300 for an advertisement, earning Mr. Hurant gross proceeds of more than $10 million from 2010 to 2015 alone.