Goldman Sachs suffered a defeat as the US Supreme Court let stand a decision forcing it to defend against claims it misled investors about mortgage securities.