Fantasy (and the genres its progenitors took inspiration from, including mythology) often use fantastic concepts as stand-ins for real-world things. Sometimes this is intentional and overt allegory, sometimes it's unconscious coding, sometimes it's just applicability; whatever the intent, it plays off of humanity's deep-set pattern recognition abilities to make a given point resonate, comment on the real world, or just communicate something about the characters or setting to the audience.
Whether you intend to or not, these parallels influence the themes or "messages" your work conveys, which can influence how people think. One story where people stab each other won't make someone want to stab someone else (though it might be a useful excuse if they already wanted to), but enough stories which convey the assumption that stabbing bad people is an effective and just way to make the world better (probably because the authors copied genre conventions without thinking through the implications) can make someone think of violence as an effective, just way to solve problems...not necessarily their own personal problems, but it affects how they're likely to view vigilante justice, foreign intervention, police brutality, etc.
If a fantasy world is ruled by active gods who empower their clergy to act in their name, the ape brain inside of us will connect that with leaders in our own world, unless the author takes active effort to distance the gods and how they act from human leaders and how they act. The set of assumptions that the writer has about how the gods should or can act will become part of their story's "worldview," which will be conveyed to the audience. Reading one story where the divine rulers of the world are axiomatically Good won't make someone stop questioning those in power, any more than watching one movie where violence is an unproblematic solution to social ills will make someone cheer on vigilante justice; however, enough authors who write with such unspoken assumptions can influence people in such directions.
If the way gods work is tied closely enough to their inhuman nature and contrasted with how mortal rulers act, a good author can prevent their unspoken assumptions about divinity from being connected with mortal rulers, which can mitigate the potential problems associated with those tropes. However, if your worldview has incorruptibility as an aspect of whatever reality is founded on, rather than a specific character trait of specific fictional characters, it's going to be much harder to avoid writing that way.
I know I've emphasized that no one author has that much influence over anyone in their audience, which might make some people wonder why what that one author writes matters. Two reasons:
1. Just because the cause is culture in the aggregate doesn't absolve anyone influencing culture from trying to make the best impact they can on their culture. Even if you're just a fanfic author read by a thousand random guys on the Internet, you have a duty to make what you write as ethical as possible. To de-purple my prose, it's the authorial equivalent of "don't be a douche".
2. Talking about authors who accidentally include harmful messages in their work (or tropes which usually do so) makes people more aware of the effect media can have on them and what this looks like. People who are aware of the methods by which media can influence them (intentional or not) and the effects it can have are, to oversimplify it, more resistant to those influences. After all, they all operate via the unconscious mind; being consciously aware of those influences reduces their effects.
2b. On a related note...for writers, the best way to avoid writing messages you didn't mean to is also to think about these things consciously. What cultural sources am I drawing on? Is there unwanted baggage associated with the tropes I'm using, and which aspects of said tropes are the baggage's source? What
(presumably positive) messages am I trying to convey, and what aspects of my work detract from those?
I'd like to recommend
these two Extra Credits videos. They're what started my journey to understanding why these aspects of culture matter.