Stories don't have to necessarily be directly didactic, but generally a story needs to show something the creator thinks is important enough to show people, and so often stories not intended as some kind of cautionary tale or fable end up teaching people the most.
Generally a story is about change. It's the story of "how X came to be" or "how Y did a thing". Slice of Life is the exception because it's not really a "story" so much as a character study. A story tends to have a point, and even when it's based on real life, it'll be pared down to details that fit that narrative.
Hamilton, the musical, is the story of how Alexander Hamilton, an immigrant from the Caribbean, became one of America's "Founding Fathers", and then the ultimate tragedy that grew out of his growing rivalry with Aaron Burr and his constant drive. Now, the official stated message of Hamilton is "You have no control who lives, who dies, who tells your story", but a person can choose to take other messages from it. They might choose to see Hamilton as an admirable figure for his relentless hard work and think he should be emulated, or they might agree with his wife and think that if Hamilton had just been able to take a break now and then, he might not have faced so much tragedy. The audience isn't told what to think on these, they're simply given the perspectives of various characters, and must think on it for themselves. The show does believe that the lack of control you will ultimately have over your own narrative as it's told in the future is a message worth explicitly telling the audience though.
In the very popular screenwriting book, "Save the Cat", it's advised that at some point in your first act, you have somebody say the thing that the protagonist will ultimately need to learn, but the protagonist doesn't heed it at the time. This is called "Theme stated". The protagonist will then go on some kind of journey (may not be a geographical journey, it could be just self-discovery) in an unusual situation, get into trouble, and then ultimately learn that lesson as they either triumph or fail. So generally, most stories have a message of some sort, or at least a theme, because they're typically the story of how a person changed in the face of an unsolvable problem and solved it by changing. They don't always come out and tell you what it is, though, and sometimes straight up telling people the message can feel preachy, or like it's a children's book. You don't see Luke Skywalker looking at the camera at the end of Return of the Jedi and saying, "You see kids, love really can conquer even the greatest evil, so never think compassion makes you weak."
Personally, I like stories with a point or a strong theme, because they tend to have a lot more drive and structure. Without a theme, stories often meander around, because there's no unifying purpose that will help edit which scenes are worthwhile in order to build towards the ultimate point or fit together. I'm not a big fan of slice of life for this reason, because I like dynamic stories where every scene feels like it's been chosen to be part of that narrative for a reason, and the creator isn't just treading water and showing me pretty things with no point.