I've come across the glib phrase "the wrong side of history" rather a lot, lately. According to a comment on the provenance of this phrase found in the link attached here, it is related to the phrase "God is on our side." I find that to be a very revealing comment.
My original suspicion about the phrase "the wrong side of history" is that it grew out of a Hegelian understanding of history. Hegel regarded history a a back-and-forth lurching from thesis to anti-thesis to synthesis. To put this in common language, history proceeds from a common piety to a reaction against it and a peaceful resolution of the conflict, i.e., a "synthesis" of the old and the new. The notion is that this progress occurs in spite of the people who bring it about, as if people are the playthings of history, rather than the other way around. Does this notion not, in effect, deify history, itself? Surely Hegel, himself, seemed to have a mystical respect for history, history, that is, as he saw it!
So, the notion that "God is on our side" mutated to "history is on our side" makes historical sense! This new mystical notion of history has replace God in the progressive mind.