The court, in a short unanimous opinion by Justice Antonin Scalia, ruled lower courts were too quick to dismiss a legal challenge arguing that Maryland Democrats engaged in unconstitutional political gerrymandering in the way they drew the state’s congressional map in 2011.