From the Wikipedia page:
The checksum field is the 16 bit one's complement of the one's complement sum of all 16-bit words in the header and text.
Why, after summing the 16-bits in the header and text, is the one's complement taken to compute the TCP checksum?