In a decision on Friday, Judge Denise Cote ordered him to repay $64.6m (£47m) in profits he made from the scheme.
She ruled that Mr Shkreli's actions had violated laws against monopolies.
Mr Shkreli is currently serving a prison sentence for defrauding investors.
But this decision is about action he took in 2015 to raise the price of Daraprim, a long-established medicine used to treat toxoplasmosis, from $13.50 to $750 - around 4,000% - overnight.
He also designed supply agreements to block competitors from offering a generic version of the unpatented medicine, which is used to treat the parasitic disease in pregnant women and patients with Aids.
The moves were unpopular, and earned him the nick-name "Pharma Bro".
Seven states and the Federal Trade Commission brought a lawsuit over the conduct in 2020, saying he had violated state and federal laws that ban anti-competitive conduct.
In her opinion, US District Judge Cote called Mr Shkreli the "prime mover" in the scheme.
"It was his brainchild and he drove it each step of the way," she wrote.
Vyera Pharmaceuticals, which Mr Shkreli founded and was previously known as Turing Pharmaceuticals, earlier agreed to pay $40m.
New York Attorney General Letitia James, one of the officials who brought the suit, celebrated the decision.
She said Mr Shkreli and his partner had illegally raised the "price of a life-saving drug as Americans' lives hung in the balance".
"But Americans can rest easy because Martin Shkreli is a Pharma Bro no more."