There's the cliche about the military being a (gender-neutral) "brotherhood" as if anyone who serves automatically makes lifelong friends, forged in the fires of adversity, blah blah blah.
The military actually is like a family for one big reason: you can't pick your family or your unit. Like it or not, you're stuck with both come hell or high water. And some of both are great, while others are toxic and dysfunctional.