They have to be aware of the shows that they are advertising on. I can’t imagine you would see a commercial for the Marines while a show like ‘Queer Eye’ is airing. It wouldn’t make any sense.
It makes perfect sense. Most of the folks who watch "queer eye" aren't gay, but they are young. They're the target audience for military recruiters. Recruiters aren't actively seeking out homosexuals, but they aren't limiting themselves to folks who are repulsed by homosexuals.
If "Queer eye" is where the right eyeballs are, it's where the Marines want their ads. It's not an endorsement of the content of the program. It's advertising doing what advertising was designed to do.