(This post is mostly based on Rav Dovid Hofstedter’s essay “Az Yashir” in his book Dorash David on Moadim. And this is just one of the many possible answers to this question.)
The Hallel (lit. praise) is a series of chapters (113-118) in Psalms that is recited during all Jewish festivals (Passover, Shavuot, and Sukkot), Chanukah and Rosh Chodesh. There are two kinds of Hallel: the full and the half. The Full Hallel (all of chapters 113-118) is said on the first night and day of Passover (first two outside Israel), Shavuot, all the seven days of Sukkot, Shemini Atzeret/Simchat Torah and all eight days of Chanukah. The Half Hallel (chapters 113-114; 115:12-18; 116:12-19; 117-118) is said on all the other days of Passover and on every Rosh Chodesh.
So we see here that on Sukkot, the Full Hallel is recited on all days. Yet on Passover, it is only done on the first one (first two outside Israel), and not even on the seventh day (and eighth outside Israel) which is a Yom Tov. Why is this?
The Midrash (Yalkut Shimoni) answers, quoting Proverbs, that we should not be happy at the the downfall of our enemies. Also, the Maharil (Rabbi Yaakov ben Moshe Moelin) writes: “We recite the full Hallel on the first two days of Passover, and subsequent [days] we say it with omissions…. For on the seventh day the Egyptians drowned, and Hashem said, ‘My creations are drowning in the sea, and you are singing a song before Me?'” He explains further that since we do not recite the full Hallel on the seventh day (which is a Yom Tov), we also do not recite it on Chol Hamoed.
But wait, did not the children of Israel sing a song, the Az Yashir, which mentions plenty of reference regarding the drowning of the Egyptians in the Sea of Reeds; and do we not recite this song daily in our morning prayers including the seventh day of Passover?
One explanation is because the song Az Yashir was essentially formed through the children of Israel’s achieving the highest level of faith and trust in G-d that resulted in them deserving to sing this song with ruach hakodesh (divine inspiration; similar to prophecy).
[It is also important to note the tense of the start of the song (Az Yashir Moshe…). We find that it is in the future tense. One interpretation says that at this time, Moses did not agree at first that the children of Israel sing it because at that time, they had not reached that highest level yet.]
Thus, this song is not just any kind of song. When the children of Israel sang it, they were past the reasoning that it was because G-d saved them or because the wicked are at long last being punished. They were only singing it solely for the purpose of describing G-d’s greatness. For this reason, it is acceptable for them to sing it and for us to recite it daily.
So why the Az Yashir and not the Hallel? Are they not both done through ruach hakodesh? Yes, they are. But our Sages decreed that the Hallel should not be said in its entirety on the day the Egyptians died as a reminder for all generations that Moses did not agree at first for the song to be sung since the children of Israel did not reach yet the level that would warrant the seeming “rejoicing” despite the suffering of another of G-d’s creations. Ultimately, we are being taught that the only justifiable expression of praise and gratitude to G-d is when it is solely for the sanctification of His Name.