There have been various rabbinic interpretations on this issue. In addition to Tamir's note on Rashi's commentary (to Megillah 3a) - that Daniel was not technically considered a prophet since he didn't publicly declare his visions to the Jewish people - here are a few other explanations.
The Rambam offers an intermediate position - arguing that Daniel had a "second degree" of prophecy, like David and Solomon (cf. Guide II:45). A vision in a dream may be inspired by Ruach Hakodesh, but not necessarily prophecy, especially if that person doesn't understand what they experienced. Regarding this "second degree," the Rambam writes:
It consists in the fact that an individual finds that a certain thing
has descended upon him and that another force has come upon him
and has made him speak; so that he talks in wise sayings, in words
of praise, in useful admonitory dicta, or concerning governmental or
divine matters-and all this while he is awake and his senses
function as usual. Such an individual is said to speak through the
Holy Spirit.
...Similarly you will find that Daniel applies to them the expression "dreams," even though he saw an angel in those dreams and heard words spoken in them. He calls them dreams even after he has received knowledge through them. Thus it says: Then was the secret revealed unto Daniel in a vision of the night. It also says: Then he wrote the dream, and so on; I saw in my vision by night, and so on; And the visions of my head affrighted me. And he says: And I was appalled at the vision, but understood it not. There is no doubt that this grade is below the grade of those of whom it is said: I do speak with him in a dream [Num. 12:6]. For this reason the nation has reached a consensus to put the book of Daniel among the Writings, and not among the Prophets. For this reason I called your attention to the fact that in the kind of prophecy that came to Daniel and Solomon, they did not discover in their souls - even though they saw an angel in a dream - that this was a pure prophecy, but rather that this was a dream communicating the true reality of certain matters. This is characteristic of the group of people who speak through the Holy Spirit. This is the second degree.
The Ramban (Gen. 18:1) strongly disagrees with Rambam's understanding of prophecy. Daniel did have visions when he was awake and asleep. In any case, the explanation that Daniel was not a prophet, according to the Ramban, is that his message came through a vision of the angel Gabriel. Angels transcend human perception, and a vision of one indicates a lack of pure prophecy:
ובאמת כי כל מקום שהוזכר בכתוב ראיית מלאך או דבור מלאך הוא במראה או בחלום כי ההרגשים לא ישיגו המלאכים אבל לא מראות הנבואה כי המשיג לראות מלאך או דיבורו איננו נביא ... וכן לא נכתב ספרו עם ספר הנביאים מפני שהיה עניינו עם גבריאל אף על פי שהיה נראה אליו ומדבר עמו בהקיץ כמו שנאמר במראה של בית שני ועוד אני מדבר בתפלה והאיש גבריאל (דניאל ט כא) וכן המראה של קץ הגאולה (שם י ד) בהקיץ היתה בלכתו עם חביריו על יד הנהר
In truth, wherever Scripture mentions an angel being seen or heard speaking it is in a vision or in a dream for the human senses cannot perceive the angels. But these are not visions of prophecy since he who attains the vision of an angel or the hearing of his speech is not yet a prophet... [Daniel's] book, likewise, was not grouped together with the books of the prophets since his affair was with the angel Gabriel, even though he appeared to him and spoke with him when he was awake, as it is said in the vision concerning the second Temple: Yea, while I was speaking in prayer, the man Gabriel, etc. The vision concerning the ultimate redemption also occurred when Daniel was awake as he walked with his friends beside the Tigris River.
Another way to understand the sages' statement on Daniel, and the status of the Book of Daniel among the Ketuvim, is to consider the contextual location, authorship, and time of Daniel's visions in Bavel. This can be understood by two other teachings from Rashi. As Rashi explains in Bava Batra 15a, Daniel's visions were written close to when prophesy ended completely, a time when the Ruach Hakodesh was waning. Furthermore, it was only written/published by the Great Assembly in the Land of Israel, at a later time from when they originally happened:
תבו יחזקאל - שנתנבא בגולה ואיני יודע למה לא כתבו יחזקאל בעצמו אם לא מפני שלא נתנה נבואה ליכתב בחוצה לארץ וכתבום אלו לאחר שבאו לארץ וכן ספר דניאל שהיה בגולה וכן מגילת אסתר ושנים עשר מתוך שהיו נבואותיהם קטנות לא כתבום הנביאים עצמם איש איש ספרו ובאו חגי זכריה ומלאכי וראו שרוח הקדש מסתלקת שהיו הם נביאים אחרונים ועמדו וכתבו נבואותיהם וצרפו נבואות קטנות עמם ועשאום ספר גדול שלא יאבדו מחמת קטנם
They [the members of the Great Assembly] wrote Ezekiel — for he prophesied in exile. And I do not know why Ezekiel didn't write it himself, if not because prophecy is not allowed to be written outside of the Land, so they wrote them after they came to the land. And thus the book of Daniel, which was in exile, and thus the Scroll of Esther and the Twelve of minor prophecies — the prophets did not write it together, but rather each wrote their own book. And Ḥaggai, Zecharia, and Malachi came and saw that the Holy Spirit was withdrawing, that they were the last prophets, and they arose and wrote their prophecies and attached the minor prophecies with them, and made them a great book that would not be lost because of their small size.
Rashi, in Ezekiel 1:3, also explains that Ezekiel first received his prophecy in Israel, which allowed him to later prophesy in exile:
ואומר אני שאותה נבואה נאמר' לו קודם שגלו שהיא ראויה ליאמר לו בארץ שאין מפורש בה גולה והיא נכרת תחלת שליחתו אליהם ויונתן אף הוא כך תירגם מהוי הוי פתגם נבואה מן קדם ה' עם יחזקאל בר בוזי כהנא בארעא דישראל תב תניינות אתמלל עמיה במדינת ארעא כשדאי
I say that this [Ezekiel's] prophecy was told to him before they were exiled, because it is worthy to be said to him in the Land, for the community of the exile is not mentioned explicitly in it. It can be recognized as the beginning of his mission to them. Jonathan [Targum], too, paraphrased in that manner: The prophetic word from before the Lord was revealed to Ezekiel the son of Buzi the Cohen in the land of Israel; it returned a second time and spoke with him in the state of the land of the Chaldeans.
If, according to Rashi, prophecy must first be experienced in the Land of Israel, it would appear that Daniel's visions, which happened exclusively in exile, are thus not considered prophecy. This is how Rashi maintains that Ezekiel was a prophet, by arguing that Ezekiel first received prophecy in Israel (as did other prophets who prophesied outside the land, such as Jonah).
For what it's worth, some of the earliest post-Biblical Jewish literature similarly classified Daniel a prophet. This includes the Septuagint, the Dead Sea Scrolls, and the Roman Jewish historian Josephus, who is most emphatic about Daniel, writing:
[Daniel was] one of the greatest prophets, and during his lifetime he received honor and esteem from kings and people, and, since his death, his memory lives on eternally. For the books which he wrote and left behind are still read by us even now, and we are convinced by them that Daniel spoke with God, for he was not only wont to prophesy future things, as did the other prophets, but he also fixed the time at which these would come to pass. And, whereas the other prophets foretold disasters and were for that reason in disfavor with kings and people, Daniel was a prophet of good tidings to them, so that through the auspiciousness of his predictions he attracted the goodwill of all, while from their realization he gained credit among the multitude for his truthfulness and at the same time won their esteem for his divine power. And he left behind writings in which he has made plain to us the accuracy and faithfulness to truth of his prophecies. (Jewish Antiquities ch.10)
Josephus should always be taken with a grain of salt. I don't mean to compare him to rabbinic tradition, only to suggest that the idea among Jews to consider Daniel a prophet stretches back thousands of years.