The judgment was delivered in the High Court in Pretoria on Thursday.
The application to have the court decide on the matter was brought by the Democratic Alliance (DA) and later joined by the Economic Freedom Fighters (EFF).
The parties argued that it is unlawful for taxpayers' money to be used for Zuma’s personal legal costs incurred during his corruption cases.
The deal was originally stuck between Zuma and former president Thabo Mbeki.
The EFF has described the judgement as a milestone in the efforts to save taxpayers' money.
"The criminal prosecution that Zuma faces, relates to conduct that has nothing to do with the public mandate he had when he was either deputy president or head of state.
"We welcome the judgment, hoping that many in the public office will learn that the state is not obliged to pay their legal costs, as long as the legal troubles they face have nothing to do with public interest,” the party says.
DA leader Mmusi Maimane believes the ruling will serve as a warning to those implicated in state capture.
"It is an important judgment because it warns all the people implicated in state capture and all the other cases that the people of South Africa will not pay for their litigations and their cost when it comes to criminal matters."
Meanwhile, the Council for the Advancement of the South African Constitution's (Casac) Lawson Naidoo says the judgment clarifies when public servants are allowed to benefit from the state providing legal services in their defence.
"The court makes a clear distinction this case that the conduct in which Mr Zuma is alleged to have committed was done in his personal and private capacity and that it has nothing to do with his responsibilities as an official of the state and there was no was responsibility for the office of the state attorney to provide for his legal expenses.”
OFM News/ Sinethemba Madolo