The 14 books and contained chapters and Halachos of the Rambam's Mishneh Torah don't seem to have any particular order based on the Mitzvos, Mishnah or Gemara.
Why did the Rambam order his books and sections in this particular order?
Rav Nachum Rabinovitch, שליט"א, in his magnum opus, Yad Peshuta, (Hakdama U'minyan Hamitzvos, Intro to the Division of the Books pp. 187-190) contrasts the Rambam's division of 14 categories of halacha as described in his Moreh Nevukhim, from that in his Yad Hachazaka. As opposed to the in the Moreh where he emphasizes the communal obligation first, the Yad is directed at the individual, "until all the laws are revealed to [both] small and great [individuals]" (Hakdama, Halacha 41 (40 in standard editions)).
Basing himself off of the Rambam's own descriptions of his 14 books, Rav Rabinovitch explains that the first books are devoted to those personal commandments that correct the individual's personal traits and actions in G-d's service. This is followed by the communal service in the Temple. Finally, the Rambam presents the laws focused on national/communal order. Accordingly, the first seven books are focused on the individual and the latter seven on the community.
Rav Rabinovitch suggests that the culmination of the work with the Book of Judges, reflects the idea that once the individual has internalized the entirety of the preceding laws, he has become worthy to direct the community. The focus overall being from the individual toward the community as a whole.
Rav Rabinovitch also cites the Talmudic passage (Shabbath 31a) describing the order of the Mishna based on the words of Isaiah 33:6:
אמר ריש לקיש: מאי דכתיב "והיה אמונת עתיך חוסן ישועות חכמת ודעת" וגו׳? אמונת - זה סדר זרעים, עתיך - זה סדר מועד, חוסן - זה סדר נשים, ישועות - זה סדר נזיקין, חכמת - זה סדר קדשים, ודעת - זה סדר טהרות. ואפילו הכי: יראת ה׳ היא אוצרו
Likewise, Maimonides first presents the books of Emunath (faith) - Madda and Ahava (also corresponding to Rabbi Yehuda HaNassi's opening of seder zeraim with tractate Berakhoth, including accepting the yoke of heaven and the laws of Shema, prayer, and blessings). The Rambam follows with the books of Itecha (times) - Zmanim, and Chossen (marriage) - Nashim, Qedusha, and Haflaa.
Rav Rabinovitch explains that the laws of kashruth are subsumed within the same kedusha theme that encompasses forbidden relations, distinguishing Israel from the nations. Likewise, Rav Rabinovitch cites Maimonides introduction to his Commentary on the Mishna explaining the connection between the laws of vows (Nedarim/Hafla'a) and of marriage.
Finally, Rav Rabinovitch explains that Maimonides completes the commandments of personal obligation with the (remaining) laws of Zeraim, based on the connection between erchin and charamin and charity.
[Lulei d'mistafina, I might also suggest that the laws tied to the unique sanctity of the land of Israel (Zeraim), naturally lead up to those laws unique to the sanctity of Jerusalem and the Temple (Avoda-Tahara). Likewise, the sanctity of the land may be considered a natural follow up to the sanctity of the people (nashim-haflaa), which may in turn follow the sanctity of time - originating with the divinely sanctified Shabbath.]
Maimonides further deviates from the Mishnaic order by postponing the books of Neziqin (Nezaqim, Qinyan, Mishpatim, Shoftim) to after those focused on the Temple service (Avoda, Qorbanoth, Tahara). Rav Rabinovitch suggests that this fits into his theme of moving from the personal to the communal. See Yad Peshuta, Hakdama U'minyan Hamitzvos, Intro to the Division of the Books pp. 187-190, inside, for Rav Rabinovitch's full discussion. It's worth noting that the overall idea includes that while there is a general overall pattern to the main sections, there are also corollaries that segue out of the main theme.