WE RECITE KESUVIM BEFORE NEVI'IM [Rosh Hashanah:Malchuyos:Nevi'im and Kesuvim]
Gemara
(Mishnah): We begin (each of Malchuyos, Zichronos and Shofaros) with verses of Torah, and finish with Nevi'im;
R. Yosi says, if one finished with Torah he was Yotzei.
32b - Inference: R. Yosi holds that l'Chatchilah one should not finish with Torah.
Contradiction (Beraisa - R. Yosi): It is praiseworthy to finish with Torah.
Correction: Our Mishnah should say, 'we begin with Torah, and finish with Nevi'im;
R. Yosi says, one finishes with Torah. If he finished with Nevi'im he was Yotzei.'
Beraisa: We may put a Sefer Torah on a Sefer Torah or on Chumashim. We may put Chumashim on Nevi'im or Kesuvim. We may not put Nevi'im or Kesuvim on Chumashim, or Chumashim on a Sefer Torah.
Bava Basra 13b (Beraisa - R. Meir): One may put Torah, Nevi'im and Kesuvim together in one Sefer;
R. Yehudah says, Torah must be by itself, Nevi'im must be by themselves, and Kesuvim must be by themselves;
Chachamim say, each of them must be by itself.
Tosefta (Rosh Hashanah 2:10): The verses (of Malchuyos, and similarly regarding Zichronos and Shofaros) begin and end with Torah, and Nevi'im and Kesuvim are in between.
Maseches Sofrim (18:3): On Tish'ah b'Av we say four verses from Yirmeyahu "Ha'Ma'os Mo'asta...", and then Tehilim 78 and Tehilim 137. Even though Divrei Kedushah always precede Divrei Kabalah, here Divrei Kabalah are first.
Rishonim
The Rif brings the corrected version of the Mishnah, and says that the Halachah follows R. Yosi.
Ran (DH Vatikin): Even though the Stam Mishnah is unlike R. Yosi, the Halachah follows him because people conducted like him.
Beis Yosef DH u'Mah she'Chosav Maschil): Perhaps Chachamim mean that he may finish with Navi, all the more so with Torah!
Ran (DH Maschil): The first Tana holds that Kesuvim are in the middle, for he says that we finish with Nevi'im. R. Yosi argues only about the end, but he agrees about the beginning. The Tosefta confirms this. The Ge'onim cite a tradition that the Kesuvim come first. The Ramban supports this from Maseches Sofrim, which says that Divrei Kedushah always precede Divrei Kabalah. Perhaps this is because Ma'alin b'Kodesh. We start with Torah, for it is supreme. Since we cannot go higher, Kesuvim are next, in order that we can then go up to Nevi'im.
Ran (Megilah 7b DH v'Chen): The Mishnah mentions Seforim; it does not distinguish Nevi'im from Kesuvim. This implies that they are equal. Likewise, the Gemara does not distinguish them regarding placing one on another. Regarding the Berachos of Rosh Hashanah Kesuvim come first, because we say verses of Tehilim, and David preceded the Nevi'im. The opinion (Bava Basra 13b) that requires Torah, Nevi'im and Kesuvim to be separate says so because each is a different matter. This is not because Nevi'im are more Kodesh than Kesuvim or vice-versa.
Rebuttal (Chidushei Anshei Shem Rosh Hashanah 9a): Kesuvim are called Divrei Kedushah, because they were said with Ru'ach ha'Kodesh. Nevi'im are called Divrei Kabalah, for they received their prophecies from Hash-m, therefore they are more Kodesh than Kesuvim. This is like the Ran in Rosh Hashanah; the Ran in Megilah is difficult.
Defense (Magen Avraham OC 153:2): The Ran holds that even though Nevi'im are slightly more Kodesh, they are not so much more Kodesh to forbid putting Kesuvim on top of them or buying Kesuvim with money from Nevi'im. However, this is difficult, for the Gemara thought that perhaps it is forbidden to rest equal Kedushos on each other. Surely even a slightly greater Kedushah is forbidden! Rather, the Ran in Megilah retracted from what he wrote in Rosh Hashanah; he holds that they are the same.
Rambam (Hilchos Shofar 3:8): One must say 10 verses in each of the three middle Berachos of (Musaf of) Rosh Hashanah, and of Yom Kipur of Yovel. The verses must relate to the Berachah. He finishes with Torah. If he finished with Nevi'im he was Yotzei.'
Question (R. Mano'ach): Why do we put Kesuvim before Nevi'im? The Halachah forbids putting Kesuvim on Nevi'im!
Note: It is not clear what his source is for this. The Ran (ibid.) and Tosfos (Bava Basra 13b DH Rebbi) say that there is no Isur to put one on the other.
Answer (R. Mano'ach): Since the Halachah is that if one finished with Nevi'im he was Yotzei, someone may forget to finish with Torah. If we say Kesuvim after Nevi'im, someone might finish with Kesuvim, and he will not be Yotzei! Alternatively, David preceded Nevi'im.
Rosh (4:3): A Tosefta (2:10) says that the verses (of Malchuyos, and similarly regarding Zichronos and Shofaros) begin and end with Torah, and Nevi'im and Kesuvim are in between. Nevertheless, we say Kesuvim before Nevi'im, because we say verses of Tehilim that preceded the verses we say from Nevi'im. The Tana of the Tosefta was not careful to teach the order. He mentioned Nevi'im before Kesuvim, for we always mention them in this order. The Ge'onim cite a tradition that the Kesuvim come first.
Korban Nesan'el (20): We say Kesuvim first because they are purely praises of Hash-m. Also, Kesuvim apply to the present as much as to the future, whereas (most) words of the Nevi'im will not be fulfilled until the end of days.
Korban Nesan'el (Megilah 4:6): We must say that really, they are equal regarding Kedushah. However, whenever we say verses of Nevi'im and Kesuvim (e.g. Musaf of Rosh Hashanah), Chachamim enacted to put Kesuvim first to honor David. The Gemara mentions Nevi'im first because chronologically they precede Kesuvim.
Note: It is not clear that Nevi'im came first. In particular, according to the opinion that Iyov was the days of Moshe, Iyov preceded Yehoshua, Rus was during the period of Shoftim, Tehilim is contemporary with most of Shmuel; Divrei ha'Yamim begins from Adam ha'Rishon and ends at the same time as Melachim, and Shir ha'Shirim, Mishlei and Koheles precede the other Nevi'im. The rest of Kesuvim are during Galus Bavel and the beginning of Bayis Sheni, but the same applies to many of the other Nevi'im.
Poskim
Shulchan Aruch (OC 591:4): We say 10 verses each of Malchuyos, Zichronos and Shofaros. For each we say three verses of Torah, three of Kesuvim, three of Nevi'im and one of Torah.
Kaf ha'Chayim (153:14): Nevi'im and Kesuvim give equal Kedushah to the parchments they were written on. However, Kri'as Nevi'im corresponds to the Sefiros of Netzach and Hod, so it is more Kodesh than Kri'as Kesuvim, which corresponds to Yesod and Malchus.