Former president Jacob Zuma has to pay back the millions the State has spent on his legal fees, the North Gauteng High Court has ruled.