How many sections were there?
The applicable Army Regulation here is AR 615-360 "Enlisted Men: Discharge; Release From Active Duty". The original regulation was dated 26 November 1942. There were thirteen sections in total. The regulation was revised in 1945, resulting in ten separate regulations 615-360 to 615-369, which replaced the original sections. Each section details exactly when such a discharge applies, as well as they type of discharge by form. Honorable discharges are white, other than honorable are blue, and dishonorable discharges are yellow.
Section I covers standard discharges, known as "Expiration of Term of Service", or ETS.
Section II Disability - Fairly self-explanatory. It outlines the process of discharging disabled soldiers and transfer to the VA system, as well as eligibility for a pension. Of note, however, that insanity is explicitly covered in this section, not Section VIII.
Section III Purchase - During peacetime, a soldier could buy out his enlistment for a price based on his length of service.
Section IV Minority - Minority applies to soldiers under the age of 18. Soldiers under the age of 16, when discovered, have their case reviewed by the appropriate service command and directed for retention or discharge under this section. Those 16 or 17 may be granted discharge by application of the parent or guardian (not by his own application).
Section V Dependency - Dependency discharges were for soldiers who had responsibility of care for immediate family members due to the death or disability of another family member. (Since we're talking Section VIII, made famous by MASH's Corporal Klinger, this is the type of discharge that Radar O'Reilly was granted to care for his mother).
Section VI Fraudulent Enlistment or Induction - This means the soldier either had previously deserted from another service (Navy, Marine Corps, or Coast Guard), was previously convicted of certain heinous crimes, concealed a previous conviction upon enlistment, or was on parole or probation for any crime, unless such parole or probation is terminated or suspended for his military enlistment. Also includes fraudulent enlistment of aliens not eligible for enlistment.
Section VII Desertion - This is an interesting one, because it is for deserters who are caught, but who are found unfit for service, either physically or mentally. They may be discharged instead of court martialed.
Section VIII Inaptness or Undesirable Habits or Traits of Character - This covers more than just insanity. It refers to an enlisted man who "Is inapt" or "Does not possess the required degree of adaptability for the military service after reasonable attempts have been made to reclassify and reassign such an enlisted man in keeping with his abilities...", "Gives evidence of habits or traits of character (except when discharge for physical or mental conditions is indicated as provided in Section III), or finally "Is disqualified for service...through his own misconduct". Furthermore, it states "No man will be separated...unless the Government can obtain no useful service from him...". Which implies if you do your assigned duties, even while wearing a dress, you aren't going to be discharged! However, this section was also used to discharge LGBT soldiers, often with a blue (other than honorable) discharge.
Section IX Conviction By Civil Court - It is "within their discretion to discharge enlisted men who during their term of service, have been finally convicted by a civil court of an offense, the nature of which clearly indicates that the individual is not a suitable person to associate with enlisted men.", or convicted of certain heinous crimes of treason, murder, rape, kidnapping, arson, sodomy, or pandering; or any crime involving sex perversion; or for any illegal dealing in narcotics..." (Pandering, in this case, would be classified as Sex Trafficking).
Section X Convenience of Government - This isn't a great as it sounds. This section is enlisted men who obtain a direct commission as an officer, or a appointment as a warrant officer. Since they are no longer 'enlisted' their term of enlistment is ended and any obligation is discharged.
Section XI Writ of Habeas Corpus - A US court may order the discharge of an enlisted soldier.
Section XII Dishonorable - A soldier may be dishonorably discharged as a result of a court martial.
Section XIII Retained For Medical Care or Hospitalization - A soldier who has reached the end of his enlistment, but still requires medical care may be retained, usually up to 6 months.