Is there a link between irrational social behavior and ideology?
Marx didn’t think so. He felt that if you came to a place where people started acting strangely (or, at least, counter to their own interests) you just weren’t looking hard enough. Hence the complicated, and in my opinion, way-way-way too convoluted system of justifications in The Eighteenth Brumaire.
I’ve yet to hear any convincingly good materialist explanation of the success of the abolitionist movement in 18th and 19th century England, either.
Might be time to do some reading.