We read Shirat Hayam on both the 7th day of Pesach and parshat Beshalach. The Torah readings include a song and, appropriately, each day's haftarah includes a corresponding song - those of Devorah and David respectively.
Why is Devorah's song read for Beshalach and David's on Pesach, and not vice versa? A tempting answer here is there is no reason, that the haftarot are essentially interchangeable. But I think I can come up with a better reason.
The difference between the Torah readings of Pesach and Beshalach is that Pesach's reading ends shortly after Shirat Hayam, while Beshalach's continues for another three aliyot, telling of the complaints about food and water and the battle with Amalek. Then comes Yitro's journey to meet the people, but that is already part of the next parsha, Yitro.
According to Ibn Ezra, the Amalek and Yitro events are related by more than textual and (perhaps) chronological proximity. Both Amalek and Yitro were among the sparse nomadic population of this part of the desert. In effect Yitro was part of the Amalekite people, yet he had chosen to separate from them and take up a less immoral way of life. Ibn Ezra says that the Yitro events happened later, but they were written here out of chronological order - to teach us that Amalek is evil not from birth but as a result of certain choices they made, while others such as Yitro faced similar choices and chose differently.
Beshalach/Yitro is not the only time we see this clarification of the eternal Divine war with Amalek. Indeed, Devorah's song contains a very similar idea. Devorah and the Israelite army defeated the Caananites, but they did not manage to capture the leading Canaanite general Sisera. Sisera successfully fled the battle scene to the tent of a presumably friendly woman named Yael. "Now Hever the Kenite had separated from the Kenites, even from the children of Hovav the in-law of Moses ... And Sisera fled on his feet to the tent of Yael wife of Hever the Kenite; for there was peace between Yavin king of Hatzor and the house of Hever the Kenite." (Shoftim 4:11,17)
Hever was from the same family as Yitro, related to Amalek, and until now he had cooperated with Yavin and Sisera in the cruel oppression of Israel (4:2-3). Thus Sisera expected Hever's house to be a refuge from the Israelites looking to capture him. But Hever's wife Yael sided with Israel and, rather than protecting Sisera, waited until he fell asleep and then killed him. Thus the victory over the Canaanites was completed and the oppression of Israel ended.
Like Yitro, Yael came from a background that strongly pressured her not to recognize and aid the more moral side of the conflict. But both Yitro and Yael had the courage to overcome this hurdle and render aid to Israel. This is the connection between parshat Beshalach and its haftarah, Devorah's song. Once this parsha and haftarah were assigned to each other, the remaining song in Nach - that of David - was left over for the 7th day of Pesach on which the Amalek story is not mentioned.