Earlier this month, two people were found guilty of the theft.
Ramaphosa confirmed that a robbery had taken place but said the money had been from the legitimate sale of buffalo from his livestock business.
Several investigations cleared him of any wrongdoing, but parliament began an impeachment proceedings in 2022 and appointed an independent panel to investigate the allegations.
The panel made a series of damaging findings, including that there was “substantial doubt about the legitimacy of the source of the currency that was stolen”.
It also concluded that Ramaphosa “has a case to answer”.
Ramaphosa initially challenged the report in court but withdrew his application after parliament voted against adopting its findings.
He revived the legal challenge again in May this year after the Constitutional Court, the country’s highest court, ruled that parliament had acted unconstitutionally by blocking moves to impeach him.
It ordered parliament to refer the report to an impeachment committee.
In his latest challenge, Ramaphosa argued that the panel had “misconceived its mandate, misjudged the information placed before it and misinterpreted the four charges advanced against me”.
The Western Cape High Court’s ruling could bring the current impeachment process to an end, unless parliament successfully challenges the decision.
If they do, and the appeal is successful, the parliamentary committee would be able to examine the charges against the president and make a recommendation.
If the committee recommends impeachment, parliament would have to vote on whether to remove him from office. This would require the support of at least two-thirds majority in parliament.
Ramaphosa’s Africa National Congress (ANC) has enough parliamentary seats to block such a move.
He is the first president to face impeachment proceedings under the rules introduced in 2018.
Legal expert Professor Richard Calland told the BBC he had expected the court ruling, given what he termed as “fault lines” in the independent panel’s report.
Calland said the court’s findings now meant that the impeachment process was “dead in the water [and] cannot continue”.
He said that any political party that wanted to revive it “would have to come up with a whole new basis” for this.
Calland said political parties who want to hold Ramaphosa accountable would likely seek to appeal the ruling but it was unlikely parliament would also do so.
“So, the president’s political career is now free of the cloud of impeachment,” he said.