why in many states voting districts before 1964 werre unequal in population

This was probably an attempt to minimize the influence that African-Americans had in the voting districts. If most districts have a minority of African-American voters, then it's likely that these districts will go to the Republicans.