It's "allowed" because the courts wanted districts created that would elect people of color. It's not just "allowed" nowadays it's very often court enforced.I still don't get why gerrymandering is allowed.
Both "sides" should oppose it. There is no question that it hurts the country - it makes both parties more extreme.