Why did the Supreme Court rule the federal government could not prohibit slavery in the territories?