A South African court on Wednesday ruled in favour of President Cyril Ramaphosa, throwing out a report that fuelled efforts to impeach him over his handling of a cash theft at his private farm.