Why does the Rambam in Mishneh Torah in the Sefer Zmanim place Hilchos Chanukah and Hilchos Purim together in Megillah vaChanukah instead of just placing them separately and why in the title is Megilah first?
They are the two yomim tovim mdrabanan, without too many halachos, so they get put together in one book. He also has one book for shofar, sukka and lulav. Megillah is first probably because it is in Tanach and a takana from the time of the nevi'im.
Chronologically the story of Purim happened before the story of Chanukah.
Also, the decrees in the story of Purim affected all the Jews, but the decrees in the time of Chanukah only affected the Jews in Eretz Yisroel.