He more talked about Judaism and Christianity, but it was relatively minor compared to actual class analysis and additionally was most famously brought up as a response to antisemetic bullshit that supported the false idea that Jewish people were controlling all of the banks and all of the money and were the source of all problems.
Marx spoke of Religion as a component of classism, not as a replacement for it, unlike what modern anti-semites do.