The short answer is: to stop black people from voting.
In late 1800 black people were already allowed to vote (black men only) but in the South, racism was still prevalent and in order to stop black people from voting, the while people in power came up with a number of additional requirements, such as having a grandfather that was allowed to vote, which many black people could not prove they had.