I cannot answer the forms of insurance that a soldier can buy, as the finances of soldiers and the day to day life of soldiers during the civil war is not my area of expertise, but I can speak with authority on the recovery of soldiers from the battlefield in general and give an overall explanation of the Army Mortuary Affairs Program and provide sources that can hopefully point you in the direction for further research.
In short:
They didn't. If the side of the fallen owned the battlefield, then it was possible that the family could provide money and a coffin to have the dead returned, but most generals did not place the recovery of the dead high on their priority of work. It was not likely that soldiers would be shipped back home to their families as most of the time the battlefield would not allow for such recovery to occur. Most of the time, the dead were placed in graves and these graves were registered, in a practice called graves registration, to be returned to the family or placed in a national cemetery at a later date. The practice of returning the dead to their families is an extremely complex logistic exercise that has taken many wars and lots of practice to perfect. The military, in its current form, has dedicated specialists for the proper identification and return of fallen comrades. There are currently three different types of recovery missions. Current Death (garrison environment), which allows for professional mortuary services on site, Concurrent Return (when Current Death capabilities are exceeded), which provides proper identification and the transport of the fallen to a site selected by the family member listed on the soldier's DD-93 (emergency contact information), and finally, Graves Registration, which is for major conflicts where the transport of a soldier will effect the larger war effort so the soldier is properly identified and then interned at a grave site in the theater of operations then later disinterred once the Concurrent Return program is reactivated.
The quartermaster corps back in the civil war did not have the necessary training or personnel on the battlefield to properly identify all fallen personnel, nor did they have the resources to return all soldiers to their families. In fact, the first two programs, Current Death and Concurrent Return are more recent advances in the Army Mortuary Affairs Program. This lack of qualified personnel combined with the issues of a rapidly moving front and the necessity of supplying material to soldiers to fight meant that the return of the dead was secondary to the primary fight, and so the vast majority of fallen soldiers were placed in registered graves, or in other cases mass shallow-graves. Brief History of Quartermaster Corps Mortuary Affairs and Army Mortuary Affairs Regulation AR-638-2
The history of returning the dead to families begins in the Seminole Indian Wars of Florida. This war was the first attempt for the Military to return a fallen officer to his family if the family provided a "leaded coffin to a 'designated Quartermaster at a port, [and] the Department would have it forwarded free of charge to a quartermaster operating in the field closest to the area of burial" (Sledge 32). The families of the fallen were responsible for bearing all the costs of the recovery and return as even though the department would have the body forwarded free of charge, no law was passed to provide the government money to pay for the expenses of recovery. The return of fallen officers was the exception, and not the rule. All enlisted men were buried in the field with limited records of their location (Sledge 32).
The first large scale effort to recover, identify and bury the fallen took place during the Civil War. The war department issued General Orders No. 75 on September 11, 1861. This order directed the Quartermaster General to create a formal system for field hospitals to keep accurate mortuary records. This order also required that each grave have a headboard with identifying information so that the grave, and the soldier interned in it, would be properly identified and registered (Sledge 33). A supplement to this special order stated:
It is hereby ordered, that whenever any soldier or officer of the United States Army dies, it shall be the duty of the commanding officer of the military corps or the department in which such person dies, to cause the regulations and forms provided in the foregoing directions to the Quartermaster General to be properly executed.
While the above order was a good start, it fell short because it did not provide for the acquisition of burial sites and it did not provide sufficient disposition facilities to meet the requirements of a mass causality producing battle (Steere 4). General Orders No. 75 also did not directly list who was responsible for the disposition of the dead. The war department issued General Orders No. 33 on April 3, 1862 to rectify the chain of command issue and enacted legislation on July 17, 1862 to procure national cemetery sites. General Orders No. 33 placed the primary responsibility of the recovery, identification, and internment of the fallen with the commanders in the field. The relevant section from this order states (emphasis mine):
In order to secure, as far as possible, the decent interment of those who have fallen, or may fall, in battle, it is made the duty of Commanding Generals to lay off lots of ground in some suitable spot near every battlefield, so soon as it may be in their power, and to cause the remains of those killed to be interred, with headboards to the graves bearing numbers, and when practicable [sic], the names of the persons buried in them. A register of each burial ground will be preserved, in which will be noted the marks corresponding with the headboards.
The key phrase in this order is "and when practicable." A field commander during the civil war could utilize this phrase to excuse placing the recovery of the dead in a lower priority than other tasks that he deemed essential to the war effort (Sledge 33).
However, while a field commander could be excused for placing the recovery of the dead as a lower priority than other tasks, the intent of the order was clear and there is very little reason to believe that commanders didn't do what they could for the fallen. To state Steere, "short of jeopardizing the chances of victory, they [commanders] did their utmost in adapting antiquated methods to new requirements" (Steere 7). After the surrender of the Confederacy at Appomattox the Quartermaster Corps was able to recover the remains of 299,696 fallen Union Soldiers from 1866-1870 and bury these soldiers in 73 cemeteries. The Quartermaster Corps was also able to recover another 13,575 and bury these soldiers near military posts or in private plots. The total estimate for interned soldiers in 1866 was 341,670. The Quartermaster Corps was able to recover a total of 315,555, or about 90% of estimated interned Union Soldiers. Of these soldiers interned by 1970, 172,109 soldiers were properly identified, or approximately 60% (Steere 7).
Sources: Army Regulation 632-2: Care and Disposition of Remains and Disposition of Personal Effects 1
Brief History of the Mortuary Affairs Program: Army Quartermaster School 2
Sledge, Michael (2005 (2007)). Soldier Dead: How We Recover, Identify, Bury, and Honor Our Military Fallen. Columbia University Press. ISBN 0-231-13514-9. OCLC 81452881
Edward Steere The Graves Registration Service in World War II 3