The LICENSES
file shipped with a current glibc mentions that it includes some code from BSD4.4. Quoting from the INSTALL
file that used to ship with glibc cca. 2009:
Most of the math functions are taken from 4.4 BSD; they have been modified only slightly to work with the GNU C library. The Internet-related code (most of the `inet' subdirectory) and several other miscellaneous functions and header files have been included with little or no modification.
This is why the headers remain preserved.
Anyway, the BSD licenses are very permissive, and they do allow doing what glibc did with them.