According to this Ngram,

the phrase first appeared in books in 1935, disappeared until 1949, and experienced an early spike in usage around 1951. A spike reaching a slightly lower peak occurred in 1967, followed by intermittent but generally up-trending popularity until reaching another high point in 1985. A slight drop-off then was followed by a sharp increase from the early 90s up to a historical high in 2000, the last year of Google's Ngram-available data.
It seems the first use noted was in The American Spectator, Volume 3, Issue 34:
The editorial bears the heading, "McDonald and Lenin," and he Times
puts itself on the wrong side of history thus: "If the British people
regard the advent of Labor Socialists without alarm, on reason is that
they know that they have to deal with a Labor government soberly aware
of its limitations and its responsibilities...The example of Russia is
a virtual guarantee against any tendency on the part..."
Whether the phrase originated with the author of this piece is not evident.
This version of the same Ngram of the phrase “on the wrong side of history” with a "smoothing" of 50, shows the general trend over time from 1800 to 2000.
