WASHINGTON — The Supreme Court on Wednesday struck down a Colorado law that made it hard for criminal defendants whose convictions were overturned to get refunds of the fines and restitution they had been ordered to pay.

“Colorado may not presume a person, adjudged guilty of no crime, nonetheless guilty enough for monetary exactions,” Justice Ruth Bader Ginsburg wrote for the majority.

The vote was 7 to 1. Five justices joined Justice Ginsburg’s majority opinion, and Justice Samuel A. Alito Jr. concurred on other grounds. Justice Clarence Thomas dissented, and Justice Neil M. Gorsuch, who just joined the court, did not participate.

The state law required people cleared by the courts to file separate civil suits and prove their innocence with clear and convincing evidence to obtain reimbursement. Critics said the law was part of a national trend to extract fees and fines from people who find themselves enmeshed in the criminal justice system.