The Braita quoted in Shabbat 21b describes Chanukah as days of Hallel V’Hoda’ah, interpreted by Rashi as the recital of Hallel and Al Hanisim. The Rambam apparently had a different version of the text describing Chanukah as days of Simcha and Hallel. In both versions however, saying Hallel is an intrinsic part of the observance of Chanukah.
This explains why the Rambam delayed his full discussion of the days when Hallel is recited until the laws of Chanukah, even though he mentioned the obligation of saying Hallel earlier in his code. Since the Rambam understands the obligation to say Hallel to be of rabbinic origin, its recital can’t help to define the biblical holidays, although we say Hallel on each of them. It is clear why lighting the menorah is intrinsic to the definition of Chanukah, but less clear why Hallel should be.
The Rambam introduces his discussion of Chanukah with a historical review of the events that led to the holiday. He describes the anti-religious decrees of the (Syrian) Greeks against the Jews, including their defiling the Temple. The first law concludes with the victory of the Hashmonaim through the mercy of the Almighty, their proclaiming a king from amongst the priests, and the return of Jewish sovereignty over the land of Israel for two hundred years.
However, if we examine that historical period carefully, those two hundred years were a problematic time. The kings were not loyal to the religious values of our sages; they were involved in dynastic feuds for succession; and the quality of high priests in the Temple did not improve. The initial miracle of the flask of oil reflected a potential return that was at best only partially realized.
How does one celebrate a wonderful miraculous moment that does not successfully fulfill its potential? One way of determining this is by analogy to a Mishnah in Berachot 54a as understood in the Gemara 60a. When a positive event occurs which will lead to later negative consequences, one makes a blessing on Hashem’s goodness and His doing good for others. One has to appreciate the blessings that one has received and not focus on future negative consequences.
The miracle of the flask of oil was the Divine indication that the victories against our enemies and the renewal of the Temple deserved establishing a new holiday, even if later events demonstrate the degree to which the full potential was not realized and decline came soon after. We praise Hashem through reciting Hallel for what occurred even if, later, human weakness prevented it from being maintained.
One might ask then that one of the reasons given in the Talmud Erechin 10b for not saying Hallel on Purim — though there was a miraculous victory of the Jews of Persia against those who wanted to wipe them out — is that even after the victory Ahashveirosh still ruled over them. The answer is that there is a fundamental difference between Chanukah, when the Jews regained independence even though they failed to maintain it properly, and Purim, when the Jews were saved but remained servants of a foreign ruler.
Recognizing that we should respond with reciting Hallel for the miracles and the victories granted the Jewish people by Hashem, and not hold back our thanks because it isn’t the full and final redemption, is one of the lessons of Chanukah. Expressing gratitude to Hashem is fundamental to Judaism. Expecting human perfection is not. A two hundred-year span of imperfect and incomplete Jewish sovereignty is worthy of being recorded by the Rambam and appreciated by the Jews annually.