Family values.

The concept of a family is something Gintoki admits he isn't familiar with in the "conventional" sense of the term. As far as we've heard in the series so far, Gintoki claims to never have had one, so the closest thing he considers as his family are the residents and workers at Otose's Snack Shop. That being said, Gintoki still seems to understand the importance and value of bonds between family members better than anyone, and is thus willing to take up his sword if it means protecting the idea of a family: whatever that word may mean.

I wish I had one... a family like yours. Ironic, ain't it? How the people who don't have things usually understand them better than the ones who do.
--Sakata Gintoki, Episode 42

Honestly, maybe it seems a little bit weird and almost intrusive to get involved in familial matters--but when others ask for help, Gintoki is (almost) always there for them no matter the cause. Whether it's as simple as pacifying the rivalry between the swordsmithing brother and sister of the cursed Benizakura sword, to something as large scale as the feuding families of the Onmyouji clans, Gintoki has the ability to mend the broken bonds between family members. His presence and aid can help people overcome some of their biggest differences, because Gintoki has a knack for bringing to light something, or someone, that people have failed to protect. In the case of the Murata siblings, Tetsuya was unable to see that he had neglected his own sister in order to forge the "perfect" sword--and it wasn't until Gintoki displayed the power of Tetsuko's poorly made sword against Tetsuya's perfected one--that he was able to see that nothing could be achieved without the presence of love for another person within his heart.

However, just as things always go at the Yorozuya, Gintoki commonly gets dragged into familiar matters he could care less about. When Okita's sister Mitsuba comes to town, Okita pretends that Gintoki is his "friend" in order to show a good face to his older sister. Gintoki plays along for Okita's sake, but becomes emotionally involved in the situation when they found out Mitsuba (who is very sickly) is involved with a terrorist who's using her simply because of her connectiosn to the Shinsengumi. Gintoki lets the Shinsengumi fight their own battles, but he sticks around to see the event unfold and offer guidance to both Okita and Hijikata, whom Mitsuba cares for as a brother and lover, respectively.

Don't worry. I just went to get some rice crackers for her. You go deliver it to her! I'm sure she'll be happier to get them from you.
--Sakata Gintoki, Episode 87
Though Mitsuba wishes for Hijikata to recognize her as something more than just a friend, Hijikata continues to ignore her feelings in order to keep her "safe" because of the nature of his job. However, when Mitsuba is lying upon her death bed, Gintoki purchases one of her favorite snacks and hands them to Hijikata, suggesting that the most important thing he focus on right now is not work--but the woman he loves. It becomes an interesting involvement on Gintoki's part, simply because it evolves the Yorozuya from a place to simply hire out an extra sword, but a shoulder to cry on as well.

Gintama presents the idea of "family" in a very complex manner--you know, kind of like that awkward talk your parents have with you about "why Jimmy has two mommies". Family isn't something that can be boiled down to simply mother, father and child. Mitsuba may have been Okita's sister, but the entire Shinsengumi saw her as a sister. When Gintoki finds himself in jailer, one of the warden is a corrupt man who delivers letters to one of the prisoners, claiming they're from his son. Later on, Gintokif inds out that his son passed away a long time ago, and the warden was simply writing the letters to the prisoner himself. Unaccepted by both the other wardens within the prison and by the prisoners themselves, he found solace in writing letters to the older man. Even though they weren't related by blood, Gintoki insists that the warden tell the prisoner exactly what he's been doing--and in the end, the prisoner admits he knew it was "his son" all along--implying that he had grown to see the warden like a son.

Warden...You've fooled the old guy for a pretty long time now...or maybe you've just been showing him the illusion of hope. But...whether you're really his son or you're really a corrupt warden, the feelings you felt for the old guy were no illusion. C'mon, it's time for the face-to-face meeting.
--Sakata Gintoki, Chapter 342
Since Gintoki's situation with the residents of the Otose Snack Shop aren't too different--he understands the meaning of "family" beyond blood relation, but as a group of people who you share a close bond with, who are worth protecting and fighting for. Though Gintoki has never really experienced a "real family" before, it's exactly that reason why he fights so hard to protect them. As someone who doesn't have a family, he wants other families to cherish that they do have one. After all, whether or not your "family" is your robot-obsessed father, the man who has you locked up in jail, or a boy who's nothing without his glasses and a girl you hit with your bike, they're the people who are dearest to you and the ones who you should fight with everything you have in order to protect.
Thanks boss... for making it possible for me to meet these rejects.
--Sakata Gintoki, Chapter 302
Petty things like swords, lovers quarrels, or prison bars shouldn't be enough to keep a group of people from loving and understanding one another. Gintoki himself has tried to set up boundaries between himself and the people he loves many times in the past--whether that was shunning off "close friends" completely or trying to disband the Yorozuya in order to keep Shinpachi and Kagura away from harm. However, throughout the series he's gradually learning to allow his friends into his life and understand that it's not just about him saving them all the time, but allowing them to come to his rescue once and awhile as well. Thats what "family" is all about.