Why is "text" in "textbook"?
According to the OED, textbook derives from an obsolete sense of text, that is, text-hand:
1730 N. Bailey Dict. Britannicum (folio), Text-Book (in Universities) is a Classick Author written very wide by the Students, to give Room for an Interpretation dictated by the Master, &c. to be inserted in the Interlines.
In other words, a text-book is a book written in a widely space format, i.e. in text-hand:
A fine large hand in writing.
a. orig. One of the larger and more formal hands in which the text of a book was often written, as distinct from the smaller or more cursive hand appropriate to the gloss, etc.R. Holme Acad. Armory iii. 414/2 These are the form of the Letters..used by the Germans; and are termed the Text Hand Letters.
b. Now usually applied to a school-hand written in lines about half an inch wide.
Text-hand, in other words, refers to the hand (script) use to represent the text— words and sentences in the original form and order, as distinguished from a commentary, marginal or other, or from annotations. Hence, in later use, the body of any treatise, the authoritative or formal part as distinguished from notes, appendices, introduction, and other explanatory or supplementary matter. Its size and spacing allows commentary to be written in between the lines.
The origin of text is Latin via French, and as the commenters note, used originally of Scripture and the like.
From the same origin comes text-writer, i.e. a professional writer of text-hand, before the introduction of printing; later, an engrosser of legal documents, from which derives the modern meaning of the author of a legal textbook.
Thanks are due to choster for their inspiring answer. I think we can paint a more complete picture with two more sources. Friedrich Kittler writes (in Discourse Networks 1800/1900, Stanford University Press, 1992, p.155) that
At the time of Republic or Scholars a lecture meant paraphrasing a standard text possessed by the professor and his students. “Even in the early eighteenth century a ‘textbook’ was still defined as a ‘Classick Author written very wide by the Students, to give Room for an Interpretation dictated by the Master, &c., to be inserted in the Interlines’ (O.E.D.).”
And according to Nick Groom (in The Making of Percy's Reliques, Clarendon Press, 1999, p.69),
In a 1765 dictionary, ‘Classick’ was derived from Johnson: a ‘classick author’ being ‘one that is placed in the first rank of credit among scholars’.
So, in those days, a university lecture meant the professor paraphrasing passages of text authored by some first-rate, well respected authors, and the students jotting down the text, while leaving wide margins between lines (and possibly between words as well) so that the professor's annotations or interpretations of the passages can be inserted.
In short, a ‘textbook’ is a book for jotting down text, rather than a printed book of standard text. Also, as FumbleFingers has pointed out, ‘textbooks’ in the old times are written by students, albeit authored by the others.