It's part of the automated configure process as far as I know. As the configure script runs, it determines the location of necessary header files (for the -I option) and libraries (-L) option. In some cases, all of the header or library files are located in the same place. If there are multiple sub-parts of the software that get configured separately, then there's a chance you'll get a repeat of options like you mentioned. The configure script generates the compile command using all the requirements of the sub-parts. So that's why you will sometimes get the repeats.
It might be argued that it's sloppy, but it doesn't hurt anything, and a lot of systems allow for command lines having 32,000 characters. So it's just not a big concern.