"Rav Simlai came in front of Rav Yochanan and asked him to teach him Sefer Yuchsin, the Book of Lineage. He [Rav Yochanan] asked him where he was from. 'Lod,' he replied. 'And where do you live?' 'In Neharda'. 'We [Rav Yochanan responded] do not teach it, neither to Lodians or Nehardeim; how much more so to you, who are from Lod and reside in Neharda'" (Pesachim 62b).
Talmudic stories are meant to convey a message in way that law cannot. At times, the message is obvious; sometimes, less so. This story clearly falls into the second category.
We are not told why Rav Simlai wanted specifically to learn this book. While it is possible that Rav Yochanan was a genealogical expert, perhaps it is connected to another well-known teaching of Rav Simlai.
"Rav Simlai expounded: 613 mitzvoth were told to Moshe; 365 negative commands corresponding to the days of sun, and 248 positive commands corresponding to the limbs of the body" (Makkot 23b). The Talmud explains that this is based on the verse, "Moshe commanded us Torah, a heritage to the community of Israel" (Devarim 33:4).
A Book of Lineage links us to our past and makes us most cognizant of our future—and that is the meaning of a heritage. Interestingly, both Parshat Breisheet and Parshat Noach have long lists of genealogies linking Adam to Abraham. But ultimately, it is not our physical origins that link us to the chain of Jewish history, but rather our moral behavior. And the Sefer Yuchsin of the Jewish people is to be found in the 613 mitzvoth.
Yet Rav Yochanan had no interest in teaching this to him. Whether he would have taught him something else we are not told, but it stands to reason that there was something about Sefer Yuchsin that triggered such a response. While the exact meaning of Sefer Yuchsin is somewhat obscure, it involves the listing of generations and genealogies of families. Tragically, the Gemara (Brachot 5b) relates how Rav Yochanan used to walk around with the tooth of his son—the tenth to predecease him. For very understandable reasons, Sefer Yuchsin with its listing of parents and children was not something Rav Yochanan was keen to teach.
While a perfunctory reading would seem to indicate that Rav Yochanan brushed aside Rav Simlai based on his places of abode, it seems rather unlikely that had Rav Simlai came from, say, Tzipori (Rav Yochanan's place of birth), that Rav Yochanan would have gladly taught him. Surely these places must be of some significance.
Perhaps Rav Yochanan was upset that Rav Simlai moved from Lod to Neharda, located in Bavel (Iraq). Rav Yochanan had established a great centre of Torah study in Tiberias. Why travel hundreds of miles when great Torah scholars are found in the land of Israel?
Rav Simlai, the Talmud continues, urged Rav Yochanan to teach him and he agreed (how can one not teach Torah to those who want to learn?). When Rav Simlai asked that they finish Sefer Yuchsin in three months, Rav Yochanan angrily responded that even "Beruriah, the wife of Rav Meir, the daughter of Rav Chananya ben Tradiyon...did not fulfill her obligation [finish] in three years, and you expect to do it in three months".
Surely, the reference to Beruriah, Rav Meir, and Rav Hananiah ben Tradiyon are not accidental. Rav Hananiah ben Tradiyon was one of the asara harugei malchut, killed by the Romans for teaching Torah. And it was his daughter, Beruriah, who taught that we must distinguish between the person and the problem. When Rav Meir cursed his neighbours for making too much noise, Beruriah rebuked him, noting that the verse says, "Sins (not sinners) should be destroyed". Rav Yochanan understanding the messages they taught had agreed to teach Rav Simlai, even if he felt he was not worthy to be taught. However, he was taken aback by his demand. Interestingly, we are never told if Rav Yochanan actually did teach Rav Simlai Sefer Yuchsin.
 Modern literary analysis does not concern itself with author intent, but rather asks whether a given interpretation of the written text is plausible. Students of Shakespeare and, l'havdil, the Rambam provide many beautiful ideas that can be elucidated from the text before them, but are unlikely to have crossed the author's mind. When Rav Soloveitchik was once asked if he felt an interpretation he was giving of the Rambam was Rambam's intent, the Rav replied that it did not matter. (See Dr. Marc Shapiro, Brisker Method Reconsidered, Tradition 31:3.)