When it comes to your fiction, these two statements are not contradictory:
Why aren't these statements a contradiction? The answer is that while the reader does not read your fiction to get a lecture, they are reading your fiction to see what you will explore. The reader is actually very interested in what thoughts are in your brain - they wouldn't be reading your story otherwise - but they want to see it explored through your characters. They don't want a diatribe on the horrors of systemic racism...they want to watch as your characters encounter, fight, and overcome it.
So, if you want to explore an issue such as systemic racism, homophobia, class iniquity, etc., how do you do it? More specifically, how do you do it while avoiding being written off as "woke" nonsense, or just another activist writer preaching "The Message"?
The answer comes down to a simple principle: Take no short cuts.
This is a problem I see in a lot of "woke" storytelling: writers thinking that because they have a character who is a visible minority/from a perceived marginalized group or because they are tackling a societal issue such as racism or sexism, that they are therefore freed from the confines of having to do the legwork when it comes to proper character development or narrative. In a way, they are treating things as tropes (storytelling shortcuts) that are not actually tropes. The end result is a story that is simplified to the point of absurdity - the reader or viewer knows, for example, that not all black people are helpless victims, or that not all white people are racist oppressors - and thus has no feeling of a greater truth behind it, or even fidelity (or sometimes sincerity).
But, while many of the "woke" storytellers will turn on their detractors and declare that their failure to capture the imagination of their audience is because of societal or fan-based bigotry, the reality is that social issue-based storytelling has been a staple of fiction for centuries. Harriet Beecher Stowe's 1852 novel Uncle Tom's Cabin was not only a massive success, it laid some of the groundwork for the American Civil War. The vast majority of readers will happily read and accept explorations of the struggle against iniquity...so long as it is done right.
What this means is that if you want to tackle racism, you must have fully developed characters with agency. There must be a fully developed narrative with an inciting incident, story beats and reverses, and a climax. The protagonist must grow as a character and be changed from the experience, finishing the story in a different place and as a different person than when the story started.
So, what might this look like? Let's create a hypothetical example of a black American teenager who, more than anything in the world, wants to be a famous musician. Through their story, we will explore systemic discrimination.
(Before I go further, I need to preface this example by stating that I know very little about the music industry. I am creating this example for the purpose of illustrating the mechanism, and thus this should not be taken as anything resembling an accurate depiction of how one becomes a musician.)
We must start by developing our character. "Black" is not a character. Who is our protagonist, and what do they want? What is holding them back from what they want? Let's say that our protagonist is an inner city kid. Their family isn't doing very well, and is barely scraping by. This means that they can't afford to send the protagonist to a music school - it also means that the protagonist starts the story by being torn over whether to enter the workforce and help pay the bills, or to chase their dream with the knowledge that by doing so their family will remain in poverty. We now have a properly realized character that any reader will be able to identify with. Our inciting incident thus becomes our protagonist conquering their first antagonist (their own fear about what will happen to their family if they don't enter the workforce) and applying to a music school in the hopes of getting a scholarship.
The good news is that our protagonist is very good at music - a prodigy, even, if left in the right hands to bring out their talent. Unfortunately, the first school they apply to is led by a racist who thinks that there is too much "black" influence in modern music - our initial, and possibly main antagonist. He rejects our protagonist's application. Our protagonist realizes that he should have been accepted, and complains. In response, the antagonist uses his influence in the system to blacklist the protagonist from every music school in the state. The entire system now becomes an antagonist to be overcome.
Our protagonist must now adapt. As they can no longer chase their dreams through a proper school, they must find somebody to take them under their wing. Perhaps a world-famous cellist finds them, recognizes their talent, and agrees to mentor them. Perhaps they find themselves playing Jazz clubs for tips to make ends meet, and attract the attention of an old but revered Jazz musician. As our story follows the protagonist work around the system that rejected them, they must still face the same stresses and pressures that anybody would in their shoes - they must still have that temptation to give up on their dream and just join the workforce to help their family make ends meet, and this must be a constant struggle for them. As our protagonist continues their journey, they also meet a variety of people who react to them and their situation in a manner that would be logical for their character.
Our protagonist becomes ready for their "graduation," and we reach a crisis point in the story. The antagonist has been following the protagonist's career, and is incensed by their success - how dare they not give up and just go away after the entire system has been turned against them! Now - as the protagonist begins seeking to join an orchestra where they can continue their career in earnest, he uses his influence to blacklist them from the orchestras as well. The climax is determined by what our protagonist does next. Perhaps they take the antagonist to court, exposing their misdeeds to the world. Perhaps they set up outside of the orchestra manager's house and play such beautiful music that the manager cannot possibly ignore it. Perhaps they give up on the system entirely, going independent and becoming a famous musician that way.
What is important about this example is that, in it, no short cuts are taken. The protagonist is a properly developed character, torn by their dreams of becoming a musician and their desire to see their family no longer struggle. They have agency throughout, making their own decisions and acting to achieve their desires. The system is turned against them because of the colour of their skin, but the people the protagonist meets along the way are themselves fully realized characters with their own way of looking at the world and their own reactions to the unfairness of the system. The reader sees the cruelty of the system when it is abused, but they see its complexities as well, and what it could be if it was truly fair. Most of all, the protagonist changes throughout the story. Perhaps they begin as an idealist and are transformed into a pragmatist and a realist. Perhaps it is the other way around - they have to be convinced to chase their dreams, and as they do they realize that no system discriminating against them can hold them down...after all, there is always another way. And, because no short cuts are taken, the story is a proper exploration without ever being a lecture - something the reader can read and enjoy because they have a protagonist they want to root for and succeed, and they are witnessing the systemic discrimination through their eyes.
To sum up, the reader wants to know what you think of the world and its iniquities - they just want it in the form of a well-told story. Provide them with one, and they will follow your exploration of the issues dear to you every step of the way, and thank you for it.