According to the spec:
Your program should then read the rest of the data from the WAV file, one 16-bit (2-byte) sample at a time.
This program is reading (and writing!) two 2-byte samples at a time. Perhaps review the fread doc again, with a concentration on the nmemb argument.