The purpose of the Talmud is talmud Torah (literally "study of Torah") in the widest sense of the word, that is, acquisition of wisdom, understanding, and knowledge, since Torah is regarded as encompassing everything contained in the world.
An allegory in the Talmud and the commentaries depicts the Torah as a kind of blueprint for construction of the world.
Elsewhere, the Talmud calculated that the scope of Torah was several times that of the world.
Thus all of life is of interest to scholars and constitutes fit subject matter for the Talmud, to be discussed in brief or at length.
The concept of Torah is immeasurably wider than the concept of religious law, and while Jewish religious jurisprudence encompasses all spheres of life and over-looks almost nothing, the scope of Torah is even wider.
Habits, customs, occupational hints, medical advice, examinations of human nature, linguistic questions, ethical problems–all these are Torah and as such are touched upon in the Talmud.
And since all of life is permeated with Torah, the sages are not merely teachers, offering ex cathedra instruction.
Their very lives constitute Torah,and everything pertaining to them is worthy of perusal.
–Rabbi Adin Steinsaltz
From The Essential Talmud, p. 95, by Rabbi Adin Steinsaltz