It’s a bit of exaggeration to say “the military” as if all service members think/vote in lock step. Most officers tend to be Republican-oriented, while a large number of enlisted tend more to the Democrats. None of us has more than anecdotal evidence about who “the military” favors or dislikes.
I retired from the military, live two miles from the base, am in regular contact with young and old, enlisted and officer, all services. I think I have a pretty good idea. Do I know any who support democrats? Sure, but the number is small overall.