בט' נחלקו בית שמאי ובית הלל:
"On the ninth [of Adar] Beis Shammai and Beis Hillel argued"
None of the commentaries on the page of Shulchan Aruch speak about what this means, nor in his Beis Yosef commentary, nor in Mishna Brura. In fact, nobody even brings a source for this minhag! As far as I can tell it doesn't appear anywhere in Chazal (not even in Megillas Taanis).
The earliest mention of it is in Seder Rav Amram Gaon (p. 5 in the pdf)
בט' בו גזרו על שנחלקו בית שמאי ובית הלל זה על זה
"On the ninth of [Adar] they decreed because Beis Shammai and Beis Hillel argued with each other"
The Aruch HaShulchan (as always) brings a bit more information (but not much). He writes:
בתשעה בו נחלקו בית שמאי ובית הלל, והיה הדבר קשה לישראל, וגזרו תענית על זה.
On the ninth Beis Shammai and Beis Hillel argued, and this day was as difficult for Israel, and they decreed a fast because of this.
I think the source for his words 'difficult for Israel' is the Raviah (vol. 2 889 in Hilchot Taanit)
He adds: the day was as difficult for them as the day on which the Jews sinned with the Golden Calf.
The source for this seems to be the Yerushalmi, which says:
דף ט,א פרק א הלכה ד משנה ואלו הן ההלכות שאמרו בעליית חנניה בן חזקיה בן גרון שעלו לבקרו ונמנו ורבו ב"ש על ב"ה ושמנה עשר דברים גזרו בו ביום:
גמרא אותו היום היה קשה לישראל כיום שנעשה בו העגל.
"Mishna: These are the laws which were said in the attic of Chananiah ben Chizkiya ben Garon, when they went to visit him. They counted and [found that] there were more of Beis Shammai than of Beis Hillel, and they decreed 18 decrees on that day.
Gemara: That day was as difficult for Israel as the day that the Golden Calf was made."
So if that is the source for the fast (and I don't know how they know the date) it would seem that the reason for fasting is not because Beis Shammai and Beis Hillel argued (which is what the Shulchan Aruch says), but because Beis Shammai had the upper hand, and passed their laws.
I'm not sure whether it is connected to the argument between Beis Hillel and Beis Shammai in Eruvin about existentialism:
ת"ר שתי שנים ומחצה נחלקו ב"ש וב"ה הללו אומרים נוח לו לאדם שלא נברא יותר משנברא והללו אומרים נוח לו לאדם שנברא יותר משלא נברא נמנו וגמרו נוח לו לאדם שלא נברא יותר משנברא עכשיו שנברא יפשפש במעשיו ואמרי לה ימשמש במעשיו:
It was taught: for two and half years Beis Shammai argued with Beis Hillel. One said that it is preferable for a person not to be created rather than to be created, and the other said that it is preferable for a person to be created rather than not be created. They counted [the majority] and concluded that it is better for a person not to be created, rather than to be created, but now that he has been created he should check his actions, and others say examine his actions.
I'm really not sure where else to go with this. It seems to raise more questions that it answers. Any thoughts? Post your answers in the comments.