I can't remember the case off the top of my head, but there were a lot of "rotten districts" back in the day, particularly in the South. This meant that there would be a Congressional district, with a small white population, and a district with a large black population, and they would have equal representation in Congress. But at least the districts themselves tended to reflect actual geographic or political lines.
The Supreme Court ruled that districts had to be redrawn so that the were, as close as possible, "one person one vote." Seems like a good idea, but this gave states license to make arbitrarily-shaped districts as long as they had roughly the same number of people in them. Maybe we're better off under widespread gerrymandering than under unbalanced districts, but it shows that good intentions can go awry. I think we'd be better off with fixed, rationally-shaped electoral districts with only rough population equality, or no districts at all and electing all representatives at large from the state as a whole with preference voting, than with state legislatures given the opportunity to re-draw electoral districts every ten years.
Another side-effect of gerrymandering, too, is that the conservativedistricts tend to be far to the right of center AND the liberal districts tend to be far to the left of center, making political compromise much more difficult.
This whole issue is one of my pet peeves, and most Democrats don't help the issue since they gerrymander just as much when they're in power. Even when the gerrymandering is well-intentioned, for example to ensure that minorities have proportional representation in a state's delegation, I still think it's a bad idea. Electoral districts ought to have some underlying basis besides number of people in them, or shouldn't exist.
This is one of my political pet issues.