Looking back, this question has had many different answers at many different times in my life. While most people will state with absolute certainty their current reason for learning history, there is often far more nuance. And with the constant battles to propagandize school curriculums one way or another, it's worth being clear on what the goal is.
My earliest recollection of learning history is in fifth grade. We covered ancient civilizations (i.e. Egypt) before spending the rest of the time on the Middle Ages in Europe. The purpose was to get a sense of how human beings, just like me, had for many many years lived vastly different lives; going so far as to dress up and roleplay different characters in a medieval banquet (I was a nobleman of course). This broader cultural awareness can be powerful and is often a discount version of the benefits of traveling as a child.
After that began the long arc of Canadian history. Starting with voyageurs and the fight for Canadian independence in grade school, taking a weird detour into residential schools in early high school, and culminating in Canada's involvement in the World Wars and the definitely-pivotal-and-totally-earth-shattering Battle of Vimy Ridge. In hindsight, I realize that this whole curriculum was designed to build up a national identity in teenagers starting to discover themselves, to really instill a sense of Canadian pride with values such as humility and courage. History became a tool to impress upon me the values of the society I was growing up in; an empowering experience if done right and a catalyst for bitter conflict if done wrong.
Throughout this period, my contemporary self never really questioned the value of learning history. The reason was clear: learning history, like keeping up with current events, was the entry ticket to the intelligentsia. It was a way to feel superior and knowledgeable. History, news, and politics were the trifecta for qualifying as a learned adult. While that reason didn't last, it did at least serve as an entry ticket to a seat on our school's Reach for the Top team, catapulting me to instant fame and generating unbounded sex appeal.
After high school, upon realizing that there were armies of people more knowledgeable than me, I was left to fill my panicked insecurity through other intellectual flexes. And thus, my relationship with history changed again. The little history I would come across was purely for entertainment. As true crime has proven over the past couple of decades, historical events can capture the human psyche more completely than even the best Agatha Christie novel. In such a way did history, in the form of The 300 Spartans or the drama of the Middle East, persist in the peripheries of college life.
A few years later I crossed the final threshold of human awakening: paying taxes. History then became a powerful tool to backtest different systems of governance and life. A way to try and answer why Canada had adopted certain social systems while the US had adopted others. And while we should be cautious about trying to extrapolate the benefits of shogunates in 21st century California, learning history does help glean potential consequences of communism or fascism.
I realize now that there is no best reason for why we should learn history. I urge you to pause and reflect on why you think it's valuable. And what part of that value you want to pass onto children, keeping in mind that curriculums are zero-sum. Are we trying to teach different perspectives or are we indoctrinating? History repeats itself, but we should be careful about what we want to repeat.