Many reasons for their enlistment: to be with spouse, "The Cause", prostitution, etc.
One example is a female soldier caught serving in the 26th North Carolina Infantry Regiment. The 26th suffered 80% casualties at Gettysburg. The greatest percentage loss of any unit in the battle:
http://thomaslegioncherokee.tripod.com/confederate.html