The more correct analogy is a sports team. Everyone works well together to win the medal, but it's much more pragmatic in that sense.
Perhaps back in the age of B&W TV, when people could spend their entire life with a company, it was sort of more true. You had that one job, you had your pension. It was really like a second family, an getting let go was like death.
I am beginning to see that nowadays, even full time jobs are becoming essentially contract gigs with better benefits. You should treat it as such anyway. Be professional, be good at what you do, but also be detached and non-emotional about it. It can end at any second.
What you take from a job is not that you were "like a family". What you take from it is the experience, what you have learned from your own mistakes, and most importantly - friendships. The rest is ephemeral like a docker container. Be ready for it to go POOF.