I didn't bother to check, but i'm betting that when a Republican was elected there in the 1870s, South Carolina was still being occupied by Federal Troops, white people weren't allowed to vote, and everyone put in power was a puppet of the corrupt central government in Washington DC.
And Republicans were the liberals back in those days.
What we term as left vs. right today really didn’t come into being until about 1896. Both parties had wide-ranging ideologies, even in the 1870s. Blacks made up the bulk of the voters in Charleston at that point before the Dems began to disenfranchise them later in the decade, doing so almost entirely by 1900. Absent that disenfranchisement, South Carolina would’ve been sending Black Republican Congressmen from the Charleston and interior areas until at least the 1960s.