Rules are made to be broken.

If there's one rule you can count on Gintama to follow, it's to "fuck the rules" completely. Not unlike the series itself, Gintoki lives by his own code and nobody else's, choosing his own ways of going about life, work and disgusting eating habits without a second thought about what anyone else thinks. He's the kind of guy that will fly down the road at a billion miles per hour without a helmet, and refuse to listen to a cop who tells him he needs one, even if it's for his own safety. Even during his youth Gintoki appeared as the rebellious type--sleeping through his teacher's classes or disregarding any ideas of the "bushido code" which his friends so closely followed. However, while at times this kind of behavior can appear completely self-absorbed and selfish, Gintoki's reasoning for living life the way he does is anything but. (Well... most of the time. The sugar addiction is most definitely an indulgent thing.)

What's the point in following that kind of Bushido? I don't want to lose any more cherished friends because of it. If my life is on the line, then I'll follow my own bushido. I'll live however I want to live and protect whomever I want to protect.
--Sakata Gintoki, Chapter 6
Gintoki's reasoning for working as a "jack of all trades" is because in the current era, you can't really choose your jobs, so he's open to doing pretty much everything and anything for money. There's always a catch of course--whether he makes it evident to his clients or not, Gintoki operates on his own set of rules. It's definitely one of the unwritten laws of the Yorozuya, but basically, anyone's job is pretty up in the air about how well it's going to get done until Gintoki decides how he feels about it. This pretty much usually means that if you're the cute weather girl Gintoki faps to every morning--you're in luck, but if you're a creepy alien Amanto with man-eating pets, maybe not so much.

During Shinpachi's first day on the job, the Yorozuya are recruited by Hasegawa Taizou (still a Bakufu official at the time, I bet you forgot he was ever anything but a Madao) to help retrieve the beloved, lost pet of an Amanto prince named Prince Hata. Though Gintoki originally scoffs at the idea of actually getting off the couch to do such a simple job, the two are dragged out and forced to comply. When they finally meet "Pesu" however, everyone's shocked to see that the so-called pet is actually a gigantic, human-eating monster worthy of a 1950s kaiju film. Naturally the plan is to catch it unharmed, but when the tentacled beast gets a hold of Shinpachi, Gintoki no longer has any intention of letting the pet live. Though it goes against his client's request, Gintoki kills the monster in order to save Shinpachi (and most likely everyone else in town). Prince Hata is incredibly distraught by this development and while Hasegawa should most likely be as well, he finds instead himself inspired by Gintoki's dedication to living life the way he wants. Hasegawa ends up losing his cool at the Amanto prince (and his position in the Bakufu) but he's ultimately thankful to Gintoki for allowing him to quit "living the lie" he was as a government official... even if it means he'll spend the rest of the series singing about cardboard boxes.

Whether the shogun or this country falls...I don’t care! Until my body shatters, I’m gonna stand straight and live my own life!
--Sakata Gintoki, Chapter 2

Crazy as it may seem, people who have the misfortune of running into Gintoki find themselves strangely inspired by his wayward lifestyle. While many may find themselves caught up whatever their life may be--robots, swordsmithing, paperwork, idol girls--Gintoki's way of living (and occasional inspiration speech) is often what helps people to remember the things that are really important in life: be it family, friendship, or simply remembering not to take yourself so damn seriously. What exactly the source all of this anarchy stems from within Gintoki is still a little unknown to me, but it defines almost everything about his character: from his willingness to help everybody and anybody (or not) to his willingness to lie on the couch and drool with a copy of JUMP on top of his face. He's not afraid in the least to stand up for what he believes is right--whether that's against one of his clients, his landlord, or even government officials, it's pretty much his way or the highway.

What is correct and what is incorrect? It isn't an easy thing to decide in this chaotic world. How can you expect to live based on rules made by someone else? If you allow yourself to succumb to the laws of others you can't decide on anything yourself and will become a freaking doll... in the end the only person that can decide is yourself, prick!!
--Sakata Gintoki