In a damning report last year, Mkhwebane - South Africa's ethics watchdog - published findings concerning a 500,000 rand ($31,460) donation to Ramaphosa's campaign from a company that is facing extensive corruption allegations.
Ramaphosa initially told lawmakers the payment was to his son for consultancy work at the company, now known as African Global Operations (AGO).
He later backtracked and said it was a donation towards his campaign to become ANC party leader - a hard-fought battle in which he beat ex-president Jacob Zuma's chosen candidate in 2017.
Mkhwebane accused Ramaphosa of deliberately misleading parliament for illegal purposes.
But the president dismissed the report and took the case to the High Court, which on Tuesday declared Mkhwebane's findings as "unlawful".
"There is simply no evidence that the president received personal financial benefit from any campaign contributions," said judge Elias Matojane.
"Her findings on the money laundering issue were not only irrational but indeed reckless," he said.
Ramaphosa's office welcomed the sentence and reaffirmed its "commitment to honest and effective governance" on Twitter.
Mkhwebane's spokesman Oupa Segalwe told AFP the Public Protector would "study the judgement" along with her legal team before "mapping the way forward".
Mkhwebane was appointed Public Protector in 2016 and her term ends in 2023.
While her position is meant to investigate public corruption and misconduct, she has been criticised for being close to graft-tainted Zuma.
A handful of Mkhwebane's other investigations have already been dismissed in court, and parliament is currently assessing her competency for the job. A few months after winning the ANC leadership, Ramaphosa went on to become president after Zuma was entangled in graft scandals that forced him to step down in February 2018.