The South Carolina Supreme Court has ordered a new trial for the man accused of killing his wife and son in a case that fascinated the US.