Why can't medical schools just take more students? I am not a doctor but I did work for some years in an admin role in a medical school. It's a very complicated degree course to organise and run well. TLDR: you can't increase numbers at the drop of a hat.
If there was a shortage of History graduates (say), the university could fairly easily recruit some more History academics to do the teaching and marking and supervise the students' dissertations, look at ways of finding more rooms for teaching (my own employer used top notch marquees on the grass for a bit when some rooms were being refurbished), check that the library resources would be sufficient (much easier now so much is accessed online instead of in hard copy) and (if they were sensible) also boost the admin support. Admissions decisions are straightforward. Does the applicant have History A level or equivalent with a good grade, and other decent qualifications? Does the personal statement convincingly make a case for wanting to spend three years studying History? In you come.
There's so much more to think about for a Medicine degree. You need a rigorous admissions stage to try to weed out the unsuitable people at the outset, and that requires clinicians and lay people to interview (usually), which is time-consuming in itself.
You also need to run practical exams as well as written exams and other assignments. The practical exams (OSCEs) are a massive undertaking, involving finding clinicians to come out of their frontline NHS jobs for a day or a half-day to act as markers, actors to come in and take on the patient role, actual patients willing and suitable to be examined by a succession of students, lots of invigilators and administrators to keep things running to time, lots and lots of rooms, equipment, partitions, technician support, all needed over several days.
Teaching: medical students spend time in lectures and seminars like other students, but they also have to learn clinical skills and that requires specialist teaching rooms and equipment, and technician support as well as clinicians employed to do the teaching, often alongside a clinical job.
And then there are the placements. Every medical school has a contract with various NHS trusts and GP practices to provide these placements, for which the NHS is paid. The quid pro quo is that the clinicians in the Trusts and practices have to provide not just a range of experience but also teaching and assessment. That takes a lot of time away from clinical duties and means there are administrators employed in the Trusts who deal just with medical students. At my place some students ended up spending a whole year on placement 50+ miles from the university so they were provided with accommodation at the hospital.
The numbers available can't be expanded at the drop of a hat. We all know the NHS is stretched to breaking point already, so hospitals and GP practices are not going to prioritise taking more students over patient care.
And finally, there's pastoral care. My impression is that decades ago it was sink or swim at medical school. Nowadays there is a lot more support given to students and attention paid to trying to help them with the emotional demands of their training, which are considerable. They work so hard and have a lot of tough stuff to process, while also adjusting, like other students, to being away from home, living independently etc etc (I'm talking about those who go to university straight from school here, obviously, but older students will have different challenges and it won't be an easy ride, as many here have made plain).
There are probably lots more things that make it difficult to expand numbers of medical students. These are just some things I noted when I was working. Needs huge planning and investment, and possibly (cloudcuckooland here, though) a huge rethink about how the medical profession operates to make medicine a more viable career option for people over 30, especially those with families, who face a huge uphill struggle to qualify, for all the reasons set out very ably in this thread by doctors and their loved ones.