It used to be the case that there were 'physical students', 'mathematical students', 'philosophical students', and 'historical students'. Somewhere in the middle of the 20th century, these switched to 'physics students', 'mathematics students', 'philosophy students', and 'history students'. Consider the following Google Ngram.
I suspect that 'medical students' did not switch because it was so common it had become a set phrase by the time of the switchover. And it was always 'law students' and not 'legal students'.
Of course, this answers one question at the price of bringing up another: why the mid-20th century switch?