Importance of garlic
In the times of the Tannaim, garlic was very important to the people. Notably, the Mishnah (Nedarim 3:10) refers to the Jews as "those who eat garlic."
It was so important to them, the custom was to write it into their Kesuvos. Consider Kesuvos 6:3:
פָּסְקָה לְהַכְנִיס לוֹ אֶלֶף דִּינָר, הוּא פוֹסֵק כְּנֶגְדָּן חֲמִשָּׁה עָשָׂר מָנֶה. וּכְנֶגֶד הַשּׁוּם, הוּא פוֹסֵק פָּחוֹת חֹמֶשׁ.
If she approprtions to bring in 1000 dinar, he apportions 15 maneh. But corresponding to the garlic, he apportions 1/5 less.
It's for this reason that the Kesuvos were called "garlic documents," as in Moed Katan 3:3:
אלו כותבין במועד...אגרות שום
These may one write on the Moed: [...] documents of garlic
and Bava Metzia 1:8:
מצא אגרות שום
If he found documents of garlic
It's presumably for its importance in marriage that Rabban Gamliel instituted (Gittin 4:2) that we write in the get
האיש פלוני וכל שום שיש לו
The man so-and-so, and any garlic there is to him
Some people would make silver garlic cloves, and they would make a big fanfare over the process, as in the Mishnah you cite from Bava Kamma. This was usually done only for orphans or for Hekdesh (Erchin 6:1):
שום היתומים שלושים יום ושום ההקדש ששים יום ומכריזין בבקר ובערב
Orphans' garlic - 30 days. Hekdesh garlic - 60 days. They would announce it morning and evening.
The Gemara (Bava Kamma 14b) emphasizes that this must be done with silver:
מאי שום כסף אמר רב יהודה שום זה לא יהא אלא בכסף
What is "silver garlic"? Rav Yehudah said, this garlic may not be except with silver.
The process was as follows: Every morning and evening, for the requisite period, they would call the court and witnesses to session (hence the announcing in the Mishnah in Erchin), at which point they would smelt, refine, and reshape the silver. It was sold as a treasure, and the proceeds used for the orphans or for Hekdesh, as discussed in Kesuvos 11:5:
שׁוּם הַדַּיָּנִין שֶׁפִּחֲתוּ שְׁתוּת אוֹ הוֹסִיפוּ שְׁתוּת, מִכְרָן בָּטֵל.
The garlic [made by] judges which was lowered by a sixth or raised by a sixth, their sale is nullified.
And it must have been sold, as Yoma 33a clearly says they did not use silver garlic:
אמר רבי ירמיה שום עצים
R' Yirmiya said, [they used] wooden garlic
and ibid. 34a:
וחביתין לנסכים שום מנחה
The griddle-cake offering precedes the libations of the Minchah garlic.
As an aside, it's these wooden and Mincha garlics that Megillah 12b refers to when it says:
א"ר לוי כל פסוק זה על שום קרבנות נאמר
R' Levi said: This entire passuk was said regarding the garlic offerings.
This practice was common enough that Bava Metzia 101a records the expression
זיל שום ליה
Go, garlic him
which means to do the above practice.
The workmanship of the garlic was impeccable. It shone brilliantly, as the morning star does at its peak. According to Megillah 13a, it's for this reason that Esther was called Esther:
ר' נחמיה אומר הדסה שמה ולמה נקראת אסתר שהיו אומות העולם קורין אותה על שום אסתהר
R' Nechemiah says, her name was Hadasah. Why was she called Esther? For the nations of the world would refer to her by the Venus garlic.
The symbolism is very clear: garlic is the means by which the entire Pesach story happened, after all. R' Abba bar Kahana once said (Shabbos 146a):
יעקב הוליד שנים עשר שבטים שלא היה בהן שום דופי
Yaakov bore twelve tribes, among whom there was no flawed garlic.
Clearly it's because they were lacking garlic, even flawed garlic, that they went to Mitzraim in the first place; the passuk records that they were looking for food. The rest of the story is summarized by Rabban Gamliel (Pesachim 10:5):
פֶּסַח, עַל שׁוּם שֶׁפָּסַח הַמָּקוֹם עַל בָּתֵּי אֲבוֹתֵינוּ בְמִצְרַיִם. מַצָּה, עַל שׁוּם שֶׁנִּגְאֲלוּ אֲבוֹתֵינוּ בְמִצְרַיִם. מָרוֹר, עַל שׁוּם שֶׁמֵּרְרוּ הַמִּצְרִים אֶת חַיֵּי אֲבוֹתֵינוּ בְמִצְרָיִם
Pesach, for the garlic which Hashem passed over the houses of our forefathers. Matzah, because of the garlic which redeemed our fathers in Mitzraim. Marror, because of the garlic with which the Mitzri'im embittered the lives of our forefathers in Mitzraim.
Arguments against garlic
Nevertheless, many disapproved of the practice of making silver garlic. Ulla's position (Shabbos 13a) was that
שום קרובא אסור משום לך לך אמרינן לנזירא סחור סחור לכרמא לא תקרב
Garlic of Closeness is forbidden because of "'Go, go,' we say to the Nazir, 'circle around, do not approach the vineyard.'"
Just as we tell a Nazir to stay away from vineyards, lest he drink, we tell people to stay away from silver garlic, as it leads one to idolatry. He calls it "Garlic of Closeness" as a euphemism, as his position is that it draws people away from Hashem.
This position is further captured by the parallel drawn by Rav Ulla (Shabbos 31b):
מאי דכתיב אל תרשע הרבה וגו׳ הרבה הוא דלא לירשע הא מעט לירשע אלא מי שאכל שום וריחו נודף יחזור ויאכל שום אחר ויהא ריחו נודף
What is that which is written, "Do not be overly wicked"? He shouldn't be overly wicked, but just a little wicked?! Rather, one who ate garlic, and its smell wafts, should he go back and eat another one, and the smell will waft more?
It's not just a metaphor, but a direct comparison between sinning and garlic. Likewise, Yosef HaBavli (Menachos 18a) referred to this as
שום פסולת בעולם
Trash garlic in the world
A compromise: flawed garlic
It's for this reason that praise is sung of flawed garlic. As R' Yehudah quoted Shmuel (Yoma 22b):
מפני מה לא נמשכה מלכות בית שאול מפני שלא היה בו שום דופי דאמר רבי יוחנן משום רבי שמעון בן יהוצדק אין מעמידין פרנס על הציבור אלא אם כן קופה של שרצים תלויה לו מאחוריו שאם תזוח דעתו עליו אומרין לו חזור לאחוריך
Why didn't the kingship of the house of Sha'ul last? Because he didn't have any flawed garlic. For R' Yochanan said in the name of R' Shimon ben Yehotzadak, we do not appoint someone to sustain the community unless he has a box of bugs hanging behind him, so that if he becomes haughty, we say to him, turn around.
A leader must come from an ignoble past. If this person becomes haughty, we show him the flawed garlic in his possession, as if to say, "You're only in this role because of your flaws."
Of course, the fact that it's broken also negates the idolatry issue. It's for that reason that it was called a Yehudi garlic (Megillah 13a):
ואמאי קרי ליה יהודי על שום שכפר בע"ז
Why was it called a Yehudi? Because it's the garlic which denies [opportunity of] idolatry [to its possessors].
The Gemara (Nazir 51b) further elaborates on this opinion:
שום מת יש לו רקב שום חי אין לו רקב
Garlic of a corpse - there is to him dust. Garlic of a living person - there is not to him dust.
Meaning: Whole silver garlic is comparable to idolatry, which, in turn, is compared to the dead (Tehillim 106:28); one who smelts one of these will die and turn to dust, as happens to an idolater. One who has flawed silver garlic is not an idolater, and, as such, "All of you who cling to Hashem, your G-d, you are all alive today" (Devarim 4:4).
While at first glance this symbolism would have shown Yeravam as an idolater long before he dreamed of making two golden calves, as the Gemara says of him (Sanhedrin 102a):
תורתו של ירבעם לא היה בה שום דופי
The Torah of Yeravam did not have flawed garlic in it
notice that this practice began shortly after Yosef ben Yoezer's death (Temurah 15b):
כל אשכולות שעמדו לישראל מימות משה עד שמת יוסף בן יועזר איש צרידה לא היה בהם שום דופי מכאן ואילך היה בהן שום דופי
All the vineyards which the Jews stood up from the days of Moshe until Yosef ben Yoezer of Tzereidah died - there was not among them a flawed garlic. From then on, they had flawed garlic.
Avoiding silver garlic in public
Nevertheless, there was a different reason for which others disapproved of the practice, which flawed garlic doesn't address: they felt that since it's unfitting for someone to eat garlic in public, as it will cause disturbances, by promoting silver garlic, it will promote the benefits of garlic in general, which will cause garlic to be eaten in public more often. There's a reason that Ezra enacted eating garlic specifically on Friday nights (Bava Kamma 82a) - that's when everyone's home, so people can partake in their garlic addiction without bothering the public at large.
Indeed, it was after Rebbi's Shiur was disturbed by someone having eaten garlic (Sanhedrin 11a) that he composed his prayer for one's host, which says, in part (Berachos 46a):
ואל יזדקר לא לפניו ולא לפנינו שום דבר הרהור חטא ועבירה ועון מעתה ועד עולם:
And may the garlic, a thing of thought of sin, not stand before him or before us, from now and forevermore.