U.S. District Judge Rosemary Collyer described Attorney General Eric Schneiderman's allegations as "so insubstantial" that the state failed to allege a breach of the agreement.

In 2013, Schneiderman accused Wells Fargo of failing to comply with several mortgage servicing standards as prescribed by the earlier settlement.

Under the February 2012 deal, Wells, JPMorgan Chase & Co, Bank of America Corp, Citigroup Inc and Ally Financial agreed to pay billions in help to homeowners and reform their mortgage servicing operations in order to atone for abuses in processing foreclosures as the housing market collapsed.

By spring 2013, Schneiderman said his office had documented hundreds of violations of the deal by Wells Fargo and in October asked the federal judge overseeing the settlement to force Wells to comply with its terms. New York said the bank was not responding to some struggling borrowers who were seeking loan modifications as quickly as timetables under the settlement required.

In the Monday order, the judge said New York's allegations covered less than .022 percent of New York loans serviced by Wells Fargo, and that a monitor appointed to oversee the settlement could address those issues.

The settlement "does not require absolute perfection in loan servicing," Collyer wrote.

She said allowing New York to go to court over their concerns "would open the floodgates to lawsuits, running afoul of the core purpose of the Consent Judgment––to resolve problems in the mortgage industry with monitoring and compliance and without litigation."

Wells Fargo spokesman Tom Goyda said the bank was gratified the court has denied the New York Attorney General’s motion.

A spokesman for Schneiderman, Matt Mittenthal, said his office was disappointed the court did not grant specific relief to consumers, but pointed out the ruling did find that states can sue to enforce the terms of the deal.

(Reporting by Aruna Viswanatha in Washington and Karen Freifeld in New York; Editing by Peter Cooney and Andrew Hay)

By Aruna Viswanatha and Karen Freifeld