You would think that a noble in a culture obsessed with honor would rather die than surrender to someone of lower birth. So what gives?
First, a recount of how Hideyoshi rose to the position that he had at his death - as we know, he was a servant of Oda Nobunaga preceding the events of the Battle of Okehazama, where Nobunaga made a name for himself by defeating an Imagawa army approximately ten times his own. Prior to this, during Nobunaga's consolidation of power in his home of Owari (following the death of his father, Nobuhide), the neighbouring daimyo in Mino, Saito Dosan, had supported Nobunaga's claim. However, upon his death, he was replaced by someone who was straight up hostile. Now, while it's clear that Hideyoshi was instrumental in some way to Nobunaga's eventual defeat of Dosan's successors, we're not entirely sure how - the leading strain that is generally accepted is that he managed to build a fortress on the edge of Saito territory, from which Nobunaga was able to garrison a large part of his forces and launch his attack. I'll add a caveat here, which is that fortresses of the Sengoku era aren't what many imagine - I go into more detail about fortresses, castles, and the like here.
From this, Hideyoshi became one of Nobunaga's highest ranking generals, and was further distinguished throughout Nobunaga's course to Kyoto and installing a new Shogun and after, including the battle at Anegawa, where we know Hideyoshi participated in and lead the vanguard of Nobunaga's army. This is ~1570, where we know Hideyoshi had under his command some 3 000 men, despite being a commoner. From here his position only accelerates, throughout Nobunaga's life and even after death by killing Nobunaga's assassin Akechi Mitsuhide. His support of the eventual successor, Oda Hidenobu, over the pre-emptive candidate Nobutaka, drove a wedge between the Oda clan, however Hideyoshi prevailed and further augmented his control over the Oda. Of course, his famous rivalry with Tokugawa Ieyasu has to be mentioned - both strong powerhouses that were appointed the guardians of the Oda regent (who was far too young at the time), they fought each other in many indecisive battles, Ieyasu submitted to Hideyoshi - it's at this point that Hideyoshi has, more or less, reached the summit of his power. Not to say that it'd decline from now (it'd remain at this level more or less for many years after) though.
Another famous struggle of Hideyoshi was the inability to directly be appointed Shogun (due to the political sphere developed by the family that controlled the Shogun regents, the Fujiwara - I talk about that a bit here), however he eventually secured the position of Imperial Regent, or kampaku. During this time, what distinguished Hideyoshi from his "common" status was that he introduced the concept of "federalism" which deviated somewhat from the earlier concept of "feudalism" (a misleading term, but that's far beyond the scope of your question) - by appointing the rule over certain regions to his vassals, rather than having an entirely centralised government, Hideyoshi was able to retain most of his supporters' loyalty.
Furthermore (and this is the second part), the premise of a culture entirely obsessed with honour is rather misleading - many followers accepted the leadership of Hideyoshi without question, as during the time it was not a question of "surrendering to someone of lower birth" as much as it was "who will give me the best outcome". This mindset was not confined to the Oda - it was the same throughout most of Sengoku Japan and even before, samurai/high ranking generals defecting if it so happened that they believed it was to their benefit. Another reason that Hideyoshi was welcomed (although this is debatable, depending on whose historiographical perspective you choose to believe in) was that he was, in comparison to Nobunaga's "tyrannical" rule, much more lenient, both to his vassals as well as to his opponents.
All of this ran alongside his fairly public attitude of magnanimity, continuing his unification of Japan, making peace with the Buddhist sectarians in provinces such as Kii, as well as the successes against the Shimazu and Hojo. So to sum it up, Hideyoshi was able to secure the fealty of all the Japanese daimyo through a combination of diplomatic skill, practicality, and military successes, which ran parallel to the stark contrast between Nobunaga's rule and his own, the support of many notable figures in between, and a bit of luck and coincidence.