Spoilers ahead for The Mandalorian. Following the fall of the Empire, an entity as precious as Baby Yoda is too pure for the lawless ways of the Star Wars universe. So even before the third episode premiered, it was clear that Werner Herzog's the Client had a sinister plan for Baby Yoda on The Mandalorian. "The Sin" doesn't explicitly detail what the Client intends to do with the Child. But Mando knows it will likely not survive whatever the plot is and goes against the code of the Guild to save Baby Yoda.
At the start of the episode, Mando is attempting to do his duty as both a member of the Guild and a Mandalorian by simply delivery his bounty to his client. Yet, Mando can't help but wonder what the Client will do with this mysterious and adorable creature. He also questions Greef Karga about the Client's intentions and displays some regret when he notes that Baby Yoga helped him defeat the Mudorm because it "did not know it was my enemy."
He's all set to go on his next job far away when he sees the ball top of one of his ship's levers is missing — the one Baby Yoda had used as a toy earlier. He rushes back to the Client's location and snatches the Child. Thanks to backup from his fellow Mandalores, they escape together in his Razor Crest — but not without some casualties.
Before rescuing Baby Yoda, Mando had heard the Client tell Dr. Pershing, "I order you to extract the necessary material and be done with it." Gizmodo theorized that the "necessary material" are midi-chlorians. Introduced by Liam Neeson's Qui-Gon Jinn in The Phantom Menace, midi-chlorians are microscopic life forms that measure how much of the Force someone has in them. Obi-Wan Kenobi noted how Anakin Skywalker had even more midi-chlorians than Yoda himself. With Yoda's count being high (even if not as high as the future Darth Vader), Baby Yoda presumably could also have a high count since they are the same race. Perhaps to use the Force for evil, the Client wants to extract the Child's midi-chlorians and put them into someone else.
There is a third person involved in the Baby Yoda plan who's ranked even higher than the Client. Dr. Pershing claims, "He has explicitly ordered us to bring it back alive." The Client isn't concerned about that detail. But Dr. Pershing claims to Mando that he has protected Baby Yoda by letting him (yes, him since Dr. Pershing uses the masculine pronoun) this long. Of course, Dr. Pershing could have saved the Child so as not to anger this third person affiliated with the Imperial army. But whatever his reasoning, Dr. Pershing's actions do allow Mando to save Baby Yoda.
As for why Mando feels compelled to save the Child comes down to his own past and not just the sheer adorableness of Baby Yoda. The forging of his new armor brings Mando back to his war-torn homeland of Mandalore during the Great Purge. In a flashback, Mando's parents hide him underground alone to protect him, but a Super Battle Droid finds his hideout. What happens to Mando from there is yet to be revealed. But simply knowing he was alone as a child and potentially held hostage by the Empire gives enough insight into why he feels so protective of Baby Yoda.
With his betrayal of the Guild, this bounty hunter is now going to be among the hunted since he holds very precious cargo that is wanted by the forces of evil in the Galaxy. But as a person who has seen the effects of what war can do to an innocent child, Mando knows the biggest sin of all would have been leaving Baby Yoda to die.