This movie is based on the ideals of "bushido," or "the way of the warrior." For those unfamiliar with this concept, it is a belief system emphasizing on loyalty, self sacrifice, justice, sense of shame, refined manners, humility, modesty, martial spirit, honor, etc. For me, it is clear why they charged into battle.
**spoiler warning**
The samurai group wanted to show the emperor that samurai values and traditionalism still has a place in Japan, and how it should not give into westernization. The ideals of bushido were so important to the samurai that they were willing charge into certain death. Some may consider this senseless b/c in western societies there's no such equivalent belief, the closest thing might be the chivary of knights, but even that is only mildly correlated with bushido.
In short, they were not fighting "a war," but rather to show how traditional Japanese values can still triumph in Japan without having Westerners manipulating their beliefs and values. So rethink what Cruise said at the end, "I will tell you how he lived." The samurai lived for the way of busido, their values, their principles, and not glory, materials or life itself. Lastly, Watanabe's character was the emperor's teacher throughout the movie, and with his death, and in which the way he died, he gave the emperor one last life lesson.