I'll just note that Salmon P. Chase, who was surely one of the most ardent advocates of the rights of the freedmen, sought the Democratic nomination for president in 1868. Horace Greeley, who was deeply hated by Democrats and another advocate of freedmen's rights, was the actual Democratic nominee. The party system was pretty confused at this point - it's not totally crazy for Grant to run as a Democrat.