WASHINGTON—The Supreme Court on Tuesday confronted the hard-edged politics of electoral redistricting, with justices divided over whether judicial intervention to stop extreme gerrymanders posed a greater threat to democracy than allowing legislative majorities to manipulate precinct maps to their advantage.

“If you can stack a legislature in this way, what incentive is there for a voter to exercise his vote?” said Justice Ruth Bader Ginsburg, a liberal who has long viewed partisan gerrymanders as a blot on the Constitution.

...