There are various themes in Fences, including racism, personal responsibility, love, and death. However, the central idea, which encompasses all these themes, is expressed in the title. Fences is about fences, which is to say barriers, which prevent the characters from being happy and successful.
Institutional racism is certainly one of the most damaging and intractable of these fences. Troy Maxson's talent as a baseball player could not be recognized and rewarded because of his race, which prevented him from being a Major League baseball player. He is concerned that similar prejudice will blight the life of his son, Cory, and this concern is reasonable.
However, Troy also creates barriers for himself and his family. While his concern for Cory's future is only natural, it does not justify his autocratic decision to prevent his son from playing football. In doing this, Troy erects a barrier between himself and Cory. His affair and his illegitimate child create a similar barrier between himself and his wife, Rose. Although Rose agrees to stay in the family home and raise the child, she tells Troy that from this point onward he is alone, a "womanless man." Only after Troy's death do the fences he built between himself and his family finally break down.