Sorry you're getting bad answers. There is actually a real answer to this.
The first part I think most people got right: you are using a different definition of materialism than Marx did.
What Marx means when he says materialism is where everyone is failing you. For example, Marx and Engels disagreed on Engels project to demonstrate that the physical world operates dialectically. Marx was very clear on his position: the metaphysical expression of that which is material is immaterial.
And here we have a glimpse of the meaning of materialism.
Material here is not a noun. It's an adjective. That which is material TO SOCIETY stands in opposition to that which is immaterial (not material) TO SOCIETY. Not "is it matter?" but "does it matter?"
Society exists in the real world. Human society is also socially constructed in the minds of persons. What is in the minds of persons is material to society, even if that which is in the minds of people refers to things that are immaterial.
How is this possible? It is possible when we use this definition of materiality:
That which is material is that which is causally linked.
That's it. Cause and effect are the easiest way to understand materiality. What is immaterial? Objective morality is immaterial. Whether something is objectively good or objectively evil has zero causal impact on the world (except mentally, but I will get to that). Whether morality is objectively real or not is also immaterial, again because of a lack of casual connection to anything. Platonic forms, also completely acausal.
So whether the expression of that causality is through substance or not is immaterial, in so far as the metaphysics has no bearing on causal relationships. If it turns out that matter is not real, as you say, we must still contend with cause-effect relationships. If your chosen metaphysics is closer to real reality than contemporary mainstream understandings, it will be judged so because it offers better explanatory power for society to bring about changes to conditions. The correct answer to what is reality is always material to society if it offers society causal mechanisms for effective change.
So what about beliefs? Persons act. That much is true. Those acts we call behaviors. Those behaviors are causally linked. They cause things to change. But what are behaviors caused by? Beliefs. Your behaviors are caused by your beliefs. And what causes your beliefs? Your experiences. Experiences cause beliefs, beliefs cause behaviors, behaviors cause changes in the world. That causes experiences? Changes in the world. So when someone behaves near you, you sense those behaviors and the changes those behaviors cause and you experience something and it causes changes to your beliefs.
Why does this matter? Well, if you believe in objective morality, your behavior will be different than if you did not. If you believe one thing to be good and another to be evil, those beliefs will impact your behavior. If those beliefs change, your behaviors will change. Therefore, what you believe is material to your behaviors, and your behaviors are material to society. Therefore, if we want to change society, we have to change it via behaviors and if the behaviors we observe are not the behaviors that will lead to the desired change then it becomes imperative to change beliefs. Knowing that beliefs change by experiences and that experiences are responses to change and change occurs through behaviors we can alter our behaviors to generate new experiences that will alter people's beliefs that will alter their behaviors that will alter society. In this way morality qua beliefs people have about morality is material but metaphysically objective morality is immaterial.
I hope that helps.