https://en.wikipedia.org/wiki/Checkerboarding_(land)
TL;DR: Railroad developers were granted alternating square mile sections as a reward for their investment.