A three-judge panel said the districts were so gerrymandered toward Republicans that they violated the state’s constitution.