That's certainly why the Navy supported Top Gun.
At the same time, you certainly could reasonably read the film as being very dubious about the military. It opens with the psychological collapse of Maverick's wingman when a MiG locks on to him, Cruise's character has to defy orders to save him, and gets chewed out for doing so.
Maverick's original motivation is clearing his father name, not patriotism. Goose dies in a pointless accident. The final dogfight is random "rescue mission" against an unnamed foe in "hostile waters" in the Indian ocean, and Cruise's character almost abandons the fight due to PTSD.
Yeah, the almost pornographic love the camera shows to the jets probably made the actual story all be irrelevant to the Navy's recruiting success. But it's easy to imagine all the whining from the Fox news personality cosplaying as Secretary of "War" about such a film if it were made today.
Cheney was sensible enough to take the win.