From reading of this decision, the problem arises from Trump's DOJ stupidity. It unknowingly sent a letter explicitly saying Texas should eliminate four majority-minority districts. Basically, the impetus for the gerrymander in black and white on paper was race which is in violation of Voting Rights Act. According to Supreme Court's precedent, gerrymandering for partisan purpose may be okay because it becomes a "political question" which can be resolved by state legislature and not by the court. Competent lawyers in DOJ have either resigned or been forced out.
Just like the case of interim US in Comey's case who stupidly made representations to the GJ that Comey has to testify to prove his innocence AND DOJ has more and better evidence at trial. If GJ proceedings are not tainted, what else is.