Well it’s easy to understand why legislatures elected by a Gerrymandered map are not motivated to fix it.
Also not trivial to design a law against it. Most common solution seems to be use of independent commissions, but commissions can also be “independent” in name only.