Simple enough question, I think. What was the logic for making participation in ROTC mandatory at so many US colleges and universities in the late 19th to mid-20th century?
It dates back to the Morrill Land Grant Acts.
The first of which was passed in 1862 with additional ones following. It set aside proceeds from the sale of federal land for each state to establish a new college, a Land Grant School as they would become known. The topics then were to reflect their purpose, bringing an improvement in the state of education, and practical sciences to the people's of each state previously shut out of higher education. Its what gave the US the majority of the X State University, X Tech, X A&M and so on. Now part of the topics to be included in the curriculum was Military Tactics, it was 1862 at the height of the Civil War after all!
From the Legislation:
without excluding other scientific and classical studies and including military tactic, to teach such branches of learning as are related to agriculture and the mechanic arts, in such manner as the legislatures of the States may respectively prescribe, in order to promote the liberal and practical education of the industrial classes in the several pursuits and professions in life. https://www.ourdocuments.gov/doc.php?flash=true&doc=33&page=transcript
So today you have Land Grant Schools such as Virginia Tech, Texas A&M, NC State, Clemson, and LSU who continue the tradition or honor it in some way along with many others. Many of the schools found it easiest to give a few lectures and a few hours of drill and call it a day with military tactics. Others went further, and modeled themselves off the various state military institutes(VMI and The Citadel mostly) and the federal service academies. This they organized their students into a Corps of Cadets, required participation and the drilling of the student body. Along with military discipline, uniforms every day, and all the rest. Overseen sometimes by active duty officers, retired officers, and in the South as often as not former CSA officers.
And we should note this is LONG before modern ROTC was formed. That would come in the run up to WW1 out of the model of the Land Grant and State institutes, and various other schemes like the Plattsburg Summer Training Camp to increase the number of men trained in the basics of the school fo the solider. Its tough enough to mobilize its even worse when your new officers are learning just ahead of their men!
So ROTC is formed to create cadre's to train on campus. And was split generally into 2 levels, the Basic and Advanced Levels. At most schools, including the Land Grants the 2 Year Basic Course was required. This would have looked at many schools just like ROTC today, some PT a few days a week, a class during the day, and one or two days in uniform as well. As by this point more and more schools that had organized as a Corps of Cadets were moving to a more traditional model and making participation voluntary all together or after a year or two. The basic ROTC instruction would also not lead to a commission, that would require wanting to and being accepted to Advanced Instruction for the final 2 years(which would come with a stipend). This split is of course still around today with the different branches having slightly different cut points, but in general having a Go/No Go point for students after 2 or 3 years. If you are selected to continue you will commission upon graduation, otherwise you are thanked for your time and shown the door with students on scholarship before then basically expected to or guaranteed to commission if they remain in good standing in all respects.
This status quo would mostly continue till after WW2. With so many returning GI's who had exemption from ROTC units had to either contract size, or work harder to recruit, with more lucrative scholarships to be offered. But it was only Vietnam and the deep unpopularity of the war that killed mandatory ROTC participation on most campuses. It was not a sudden thing and by and large was a school by school choice as the requirement to teach military tactics by the Land Grants had been dropped, and partly just acknowledged to b replaced by the presence of ROTC units on campus as an offering.
The why then was simple. To not have to repeat old difficulties. Having a body of men either familiar with the basics of military schooling, or who had a few months active service and were in the reserves would greatly ease the issues of mobilizing a large number of draftees into new units.
To give some illustrative examples we can look at two schools. The University of Kentucky and Virginia Tech. UK started as a Cadet school but eventually made it optional after 2 years, then only required taking the ROTC classes for 2 years, then dropped that all together: https://armyrotc.as.uky.edu/node/150781
VT though was different, like Texas A&M it held onto its Corps of Cadets as a distinct school run student organization, just on a completely voluntary basis. While in parallel having ROTC as an option for Cadets which became completely voluntary so a student could graduate the Corps but not have participated in ROTC for instance. https://vtcc.vt.edu/about/history.html