Soldiers having any kind of skills that might aide the war effort were detailed for various purposes. Oftentimes the detail was permanent -- on others it was only temporary. If the soldier had any kind of disability the detail was likely to be permanent. Details usually (bit not always) included assigned to a town well inside Confederate lines where supplies could be stockpiled and production and distribution take place in undisturbed.
When Congress passed the law requiring men between the ages of forty-five and fifty to enroll, the stated purpose of the law was to relieve able-bodied men assigned to rear-area details and send them back to the army.