I realize Wikipedia is not particularly reliable, but I'm going to presume that it gets basic facts correct like:
While I realize the dude is probably far from being considered progressive by modern standards, this seems pretty extreme for an ex-Confederate General. What caused this relatively drastic shift in beliefs?
Without commenting on Longstreet himself, I think it's worth noting that just because someone fought for a particular side in the Civil War that doesn't necessarily mean they were perfectly ideologically aligned with that side. In a society in which family and community ties were extremely important, people often fought for reasons of loyalty to their family/city/state to the exclusion of ideological considerations. Even Robert E Lee had complex and contradictory attitudes toward the issues of slavery and secession.