South Africa's Constitutional Court has ruled that parliament had failed to hold President Jacob Zuma to account over a domestic scandal.