South African Finance Minister Pravin Gordhan has fought back against allegations that he had "spied" on politicians in his previous role.