Earl Spencer's former school is set to close as a result of tax changes for private schools.