One of the major shifts occurred during the Civil War.
The Morrill Land Grant Act required the instruction of military tactics in all the new schools founded by the Act. Along with mechanical engineering, agricultural science, and the arts. The better to ensure a general level of standards amongst the officers despite the massive need for numbers beyond what existing officers could provide or had time to train.
Some schools like Virginia Tech, LSU, and NC State retain parts of that tradition. Along with TAMU of course.
But in general it was an American expansion of the class division between officers and enlisted, and with the small peacetime military it was easier to implement and the idea take hold naturally as a social group seeking to impose standards on joining. When the officer Corps came almost entirely West Point, or state schools like VMI, or The Citadel, it's easier to close ranks and not let anyone below that percieved level of qualification from joining.
While still never hard and fast, by WW1, and the formation of proto ROTC, it was as close to a hard and fast rule as it ever had been since.