It's been noted so often that I don't know who said it first that communism became a secular religion, which in retrospect was sort of inevitable; Marx swapped Hegel's idealism for materialism, but kept the rest of his philosophy of history mostly as-is, and history being the World Spirit figuring itself out is a theological notion even if you replace the World Spirit with humanity. I don't think it can work that way anymore, and I don't think I'd want it to; I have never known a True Believer in communism, but I've known enough True Believers in The Market and in God to know I don't like True Believers.
Is this an idea of Marx's? The "World Spirit figuring itself out" per se? You're right that there's a lot to be wary of. Belief leads to all kinds of behavior, so whatever transcendental movement takes seed, we best be choosy. The demystified and disenchanted secular world we live in is probably better than an alternative one of groupthink. Cohesion, like empathy, is often thought of as a good thing but it's value-neutral, and, in fact, can be dangerous.and history being the World Spirit figuring itself out is a theological notion even if you replace the World Spirit with humanity.
The World Spirit figuring itself out was Hegel. Marx started out as a Left Hegelian, and his famous "turning Hegel on his head" was dialectical materialism, replacing the World Spirit figuring itself out with material conditions shaping economic conditions shaping ideology, which is a smaller change than it looks like at first glance.