The DoD was totally on board with
The Avengers until mid-way through production when, according to US Defense Department Hollywood liaison Phil Strub, it became confusing to the powers that be where, exactly, the Strategic Homeland Intervention, Enforcement and Logistics Division would fall in the current bureaucratic command structure:
"We couldn't reconcile the unreality of this international organization and our place in it. To whom did S.H.I.E.L.D. answer? Did we work for S.H.I.E.L.D.? We hit that roadblock and decided we couldn't do anything [with Avengers]."
According to
Wired, Marvel tried to explain—with what must've been a straight face—that given the word "Homeland" in its title, S.H.I.E.L.D. would be part of the Department of Homeland Security, not the Department of Defense. If S.H.I.E.L.D. was a real organization. Which it is not. Because
The Avengers is a work of fiction.