Supreme Court rules states can bar insanity defense