By 1863 it was common for the Confederates to send scouts/spies into Union lines as "deserters". During the initial stages of the Chattanooga campaign Rosecrans thought this meant that the AoT was in it's final death throes, and gave orders for the "deserters" to be allowed to return to their homes unmolested by Union forces. But more than a few Union officers thought this was foolishness, for as soon as the Union army passed by, many of these "deserters" would return to the AoT with specific information on the numbers, order of battle, and route of march of the Army of the Cumberland. But by 1864 Sherman was said to have taken a decidedly different approach, requiring "deserters" to surrender their weapons and accouterments, and be sent off to assembly areas where they couldn't re-join the Confederate forces at a more convenient time. But by March 1865 it was rather late in the game for this tactic.
My thought is that your ancestor probably was starving and lured in by the promise of good rations. To those who are truly starving over months at a time - not merely suffering from a "knawing appetite" which most of us feel at one time or another - food can be an incentive too strong to overcome. Since he had close relatives who had died in the service, the concern over the future welfare of his family may have been strong also. He may have been in a situation where his commander SHOULD have surrendered, but refused to do so - in such a case, the line between surrender and desertion isn't quite so clear.
In general, remember that no one wants to be the last one to die in a war.
A story my own father told me, from the Korean War, where he was a combat engineer. One day an older man appeared with transfer orders into the unit. A few of the more mischievious men in the unit decided to give this "newbie" an intruduction into combat, by driving him in a jeep in an area which was under Chinese observation and where jeep traffic would frequently be greeted with mortar fire. They knew that if you varied the speed of your vehicle, then the morter fire couldn't be zeroed in, but the new guys wouldn't know that. But this time, their little trip along the road was met not with mortar fire, but with a barrage of heavy artillary which appeared to have the entire road covered. They bailed out of the jeep, jumped into holes, and waited for the fire to abate. After some twenty minutes of heavy fire they ran back to the base (the jeep was a smoking hulk by then). They came to my father, who was company commander at the time as a 1st Lt., and said that the new guy was crazy, they had to do something to transfer him out! According to them, they were trying to dig deeper into impact craters using their fingernails and crying, while he was rolling around, laughing - he seemed to think it was the funniest thing he had seen in years!
My Dad called him the new guy into his bunker and asked him what was going on. The new guy, in a thick German accent, explained how he had fought for almost five years on the Eastern Front in WWII, then deserted (avoiding the Gestop summary execution squads) so he could get back home within the western zone before surrendering. Somehow he had immigrated to the U.S., and upon getting his citizenship he promptly signed up for the U.S. Army. He had been a soldier since he was a teenager, and that's all he really knew how to do, he explained. He thought it was hilarous when the G.I.s tried to scare him with the jeep trick, he figured out pretty quickly what was going on. Seeing them so scared at a "little barrage" was hillarious to him - on the Eastern Front they would have considered this little more than a nuisance.
I'd love to know more about this guy's story, but my Dad died at age 45 (shortly after I turned 16), so I didn't get to ask him many details.