One sentence
North had recources to feed prisoners but did not and refused swap for your beloved Federals at Andersonville
So did the South but they starved them to death anyway. And prisoner exchanges were halted because the rebels refused to consider black Union - the ones they didn't murder first that is - to be soldiers.
Where the US didn’t have resources to feed prisoners, such as Appomattox Courthouse or Vicksburg, many thousands of soldiers were paroled, without exchange, and they were given what food was available.
The lack of resources is not much of an excuse for maltreating prisoners. The Confederates captured prisoners knowing full well they couldn't feed them.
In all fairness to the Confederates, much of the suffering at Andersonville was inflicted by prisoners on each other. It was truly a "survival of the fittest" scenario, with gangs preying on weaker gangs or unaffiliated prisoners ... about what you would expect when life is reduced to its basest elements.
Which is not to minimize the sadism and brutality of some of the Rebel guards, who would entice starving men across the "dead line" and then shoot them for sport.