They actually are canonical in some bibles, most notably those used by the Roman Catholic and Eastern Orthodox religions. They also appear in the Septuagint (the LXX), but they are not in the Hebrew Bible. Scholars think the canon of the Hebrew Bible was decided (or at least discussed) during the Council of Jamnia around 90 CE. Records from that time are extinct, so their exact reasoning is unknown.
That hasn’t kept scholars from coming up with various theories on the matter. One is that only books written in Hebrew were included in the canon. That would work except for the fact that most of Daniel was written in Aramaic and Daniel made it into the canon. Also, some scholars think that at least 1 Maccabees might have been written in Hebrew, so that theory is difficult to maintain. This same argument can be applied to those who think it was a matter of dating. If the books were written quite late, they might not have been considered. But, the book of Daniel was written at approximately the same time and it is definitely canonical.
Others suggest that the decision might have been a matter of politics. There was a pointed rivalry between the Sadducees and Pharisees during this time. The Sadducees were a priestly class in charge of the temple. They differed on many doctrinal points from the Pharisees. The Council of Jamnia was a Pharisaical school, while the Maccabees were a priestly family. It might have been the Pharisaical rabbis who refused to include a book praising a priestly family.
Then, there is the issue of content. 1 and 2 Maccabees tell the story of a successful revolt against the Seleucid kings. In 90 CE, the Jews found themselves again without a temple and exiled from Jerusalem. This had all happened because they had tried to rebel against the Romans. Perhaps the rabbis felt this simply was not the time to highlight a previous revolt, even if it did result in the institution of a festival as significant as Hanukkah.
The great irony, of course, is that the Christian Bible was originally based on the Septuagint, which included these books. That probably gave the Jews another reason not to include them in the Hebrew Bible, but it is because of the Christians that we even know these stories. They were part of the Christian scriptures for centuries. At the time of the Reformation, these books, among others, were relegated to secondary status in the Protestant Bible. That decision might have been influenced by events dating back to the fifth century CE, when Jerome published the Vulgate, a Latin translation of the Bible. Because these books were no longer part of the Hebrew Bible, Jerome coined the phrase “second canon.” Some scholars argue that that was the reason why Martin Luther excluded them. Others think that he had some doctrinal disagreements with the books, notably on the issue of prayers for the dead.
No one disagrees, however, that both these books contain a wealth of information about the latter part of the second and first centuries BCE. This fills in the background for first century Palestine -- the period out of which Christianity emerged. In addition, it is from these stories that we first hear about the Pharisees and Sadducees and Zealots. 2 Maccabees also coins the first use of “Judaism.” In short, included among their pages are stories involving the expectation of resurrection, the expiatory value of martyrdom, a doctrine of suffering, and prayers for the dead. Mostly, these books are about courage in the face of suffering, the willingness to sacrifice one’s life for what is right, and justifiable violence. These are really timeless topics; people still struggle with such issues today.