In March President Cyril Ramaphosa announced that taxpayers would foot former president Jacob Zuma’s legal defence bills, which then amounted to $127,500 and are no doubt mounting by the day.

More recently the president’s representative clarified that only the costs of Zuma’s defence during his actual trial will be covered and he will have to convince the state attorney that he is entitled to legal funding for any cases that are not directly linked to the actual corruption case against him.

Among other alleged and proven acts of corruption and racketeering, Zuma spent at least $23m of taxpayer money to upgrade his home with a new swimming pool, amphitheatre and cattle enclosure. To give you an idea of how much that is, according to AfricaCheck the country could have trained between 5,125 and 7,935 engineers, doctors or lawyers for that amount of money.

Zuma’s corrupt administration is estimated to have cost SA at least $50bn and caused the economy to spiral into crisis, with unemployment anywhere between 28% and 36%, depending on the definition, and youth unemployment well over 50%. Furthermore, 60% of people in the country live on less than $3,000 a year.

Yet even after Zuma left office he once again managed to collect from the taxpayers after state prosecutors filed 18 criminal charges against him. But why should the taxpayer have to pay the legal fees of someone who has enriched himself, his wives, his family and his friends by ruining the South African economy?

Although Ramaphosa justified himself in spending other people’s money on Zuma’s legal fees, he may have no legal justification for doing this, because the Constitutional Court has already held that Zuma violated his duty of loyalty to the taxpayer.

The president says he can do this under section 3(3) of the State Attorney Act 56, but citing that law for justification is a bit left field. Section 3(3) states that the state attorney can defend or prosecute someone who is "not a party" but is "interested or concerned" with the government.

A case like this may come up if a contractor (not a government party) is building a road under the government’s direction (which makes one connected to the government) and somebody gets injured. If the injured party sues the contractor, the government may choose to defend the party in a lawsuit. Clearly, this law doesn’t apply here.

My research doesn’t show any express South African law of indemnification (a third party’s obligation to pay for damages and legal fees) regarding government officials, administrators and employees. If this is true, the remaining question is: can the president authorise the payment of these fees?

As most good lawyers will tell you, the answer is complicated, especially indemnification law. But in this case it appears that the office of the president cannot do so. Some background on law is needed to explain why. Generally, indemnification requires the government to pay an employee’s legal fees if the proceeding was brought because of a government worker’s action done in the scope of employment.

Absent statute, generally, common law enables the executive to indemnify almost anyone for almost anything. But an exception arises if the accused has breached his or her duty of good faith, or the duty of loyalty to the taxpayer. In the US, the corporation code regarding indemnification was in fact revised recently, since legal experts were concerned that paying legal fees for anything would encourage company directors and executive officers to steal from shareholders. Minimal legal limits are now required.

What all this means in the government context is this: if Zuma, as president of SA, made decisions solely to profit him, his family or his friends, the government is barred from paying the former president’s legal fees, even if it wants to.

This is why Ramaphosa’s decision is actually illegal. The public protector has already declared several of Zuma’s decisions to be in breach of good faith and hence issued a binding order requiring him to pay back the money spent on renovating his private home.

Furthermore, the Constitutional Court upheld the public protector’s decision, adding that the president had failed to "uphold, defend and respect" the Constitution. The two rulings are clear and binding findings of a breach of good faith. (It may be a different story if no such authoritative findings had been made.)

In my opinion, paying Zuma’s legal fees once again breaches the Constitution because it perpetuates the original violation of Zuma’s failure to "uphold, defend and respect" the people’s rights.

To be sure, as much as the public dislikes Zuma, unjustly retaliating against former public officials must be protected against. Political leaders may have made decisions they genuinely believed were in the public interest and later turn out to be wrong, and are disliked for it. In those cases, to ensure the continuity of government, retaliation must be curbed by indemnifying.

But this is not the case here. Here, the solution is clear. The government must revoke Zuma’s legal fees and require him to return what’s already been given to him, including legal fees and other illegally obtained moneys.

• Cook is a US attorney who has argued indemnification law