Because unlike controlled assessment or coursework you can't know the question and you have to be flexible enough to answer any question which means you need skills and knowledge
At university level in my subject, essays are almost universally a better indication of a student's abilities than exams. Longer essays of course don't automatically mean better, but in time-limited periods the depth of answers produced does not give you as strong a sense of ability. It is not possible to ask for depth if you want the exam to cover a good part of the curriculum. Indeed, one of the reasons we still have dissertations is that this is the strongest indicator of ability as students have time and space to show what they know.
I have been setting and marking university exams for over 15 years. I also have some limited experience of GCSE & A level. I would really disagree with you about what exams can test.
The critical skill tested in exams is memory, which is not that useful in itself as outside of exams, it is always possible to work around.
The knowledge displayed of exam technique is often rewarded more than knowledge of the subject. This is especially true give the formulaic marking schemes that now exist at GCSE and increasingly A level.
It might be different in different disciplines, but I should imagine most subjects that require discursive answers would be the same.
Clearly if we return to more open questions which can be answered in multiple ways, more knowledge would be required. But this needs a lot more judgement and flexibility on the part of the examiners, and exam boards have not yet ,as far as I can see, shown any inclination to do this. Just removing coursework in favour of exams does not change formulaic teaching to the test.
If you think about the world after school, there are very few areas in life in which you are required to demonstrate skills and knowledge in a time-limited period without reference to anything else. The driving test is one example, but most people agree that passing your driving test is not the same as being a competent driver. The persistent use of exams in school as a way of gauging skills and knowledge is traditional rather than a sound pedagogical practice.
BTW, if you ask for electronic copies of work, then the risk of internet plagiarism is now no more significant than other forms of cheating. There are plenty of good software systems that can detect copying (the only exception to this is where the source is in a different language to the piece submitted).