The Talmud is the written record of the Oral Law. With the destruction of the Temple and subsequent exile of the Jewish people, it was no longer feasible to rely on oral transmission of our tradition. In recording teachings spanning some 600 years, both the Mishnah (circa 220 CE) and the Gemara (circa 500 CE) meticulously recorded not only what was said, but who said it, and in whose name it was said. The reasons for such emphasis on proper attribution are many and varied, and go beyond the important need for historical accuracy, serious scholarship, and proper acknowledgement of sources.
The Talmud is the source of the Jewish law, yet it would be hard to describe it as a book of law. Much more than a listing of rules, the Talmud records the discussions of our Sages that took place over hundreds of years. There is an astonishing range of views, with many of these views contradicting one another. Such contradictions need not be resolved--unless someone contradicts himself.
Often, views can only be properly understood on the basis of who said them. The concept of "lshitato", where a Talmudic view is explained based on another statement made by that same person, is operable only if we know who said what.
But as is often the case, there is much more than just practical necessity behind these attributions. By recording not only the names behind each opinion, but in whose name it was said--a listing that can go back three, or even four generations--there is an added sense of continuity to our tradition. A statement made by Rav Yehuda in the name of Rav, as opposed to one made by Rav Yehuda in the name of Shmuel, brings us closer to the world of both Sura and Neharda, the two great (and distinct) Babylonian yeshivot headed by Rav and Shmuel respectively.
There is something heartwarming in passing on a piece of our tradition in the name of the sages who came before us, who are quoting the sages who came before them, and so on and so forth. Recording the links in our tradition strengthens that tradition. It is for good reason that Pirkei Avot opens with the transmission of Torah from generation to generation.
There is an additional, perhaps more mystical, reason for the importance of recording a teaching in the name of its author. "Ulla came to Pumpedita", we are told (Pesachim 104b). Late one Shabbat afternoon, Rav Yehuda told his son, Rav Yitzchak, to bring to Ulla a basket of fruit--something that would enable him to witness Ulla making havdalah. The exact order of havdalah had yet to be settled, and Rav Yehuda wanted to hear how Ulla did such.
Instead of going himself, Rav Yitzchak sent Abaye in his stead. When Rav Yehuda inquired as to Ulla's havdalah, Rav Yitzchak told him that it consisted of "hamavdil bein kodesh lechol" and no more. He added that he himself did not go, but actually sent Abaye. Rav Yehuda was not impressed, telling his son, "Your arrogance and your pride cause this teaching not to be said in your name". Instead of this teaching being quoted in the name of Rav Yitzchak in the name of Ulla, it was Abaye who was quoted for posterity.
As Rashbam notes, Rav Yitzchak lost a piece of eternity, quoting the Talmudic teaching that "all students of whom something is said in their name, their lips move in the grave" (Yevamot 97a). Torah is the link between the living and the dead. In the Beit Midrash, Abaye and Rava, the Rambam and the Ra'avad, the Vilna Gaon and the Noda B'Yehuda are not figures from the past, but are present before us. "The righteous--even in death--are considered alive". When a particular teaching of someone is quoted, even if that person is only the transmitter of that teaching, one attains a measure of eternity, linking the Jewish past, present and future. And doing so may hasten that future: "Whoever says something in the name of the one who said it brings redemption to the world" (Avot 6:6).
 While one would expect the discussion regarding havdalah (and kiddush) to take place in Masechet Shabbat, such discussion actually takes place in Pesachim, as the Gemara greatly elaborates and expands upon the Mishnaic teaching that even the poorest of the poor must be provided with four cups of wine for the seder. One cannot truly master any topic in Talmudic law unless one has mastered the entire Talmud.