Why do universities require international students to show language proficiency? For example, Let's say an American person wants to attend a French university F. F explicitly states that French is the main language of instruction. Why would they require the student to take a language proficiency test for admission? Any prospective student should be aware that he or she has to know French in order to follow the lectures or when taking oral/written exams. Why don't they simply trust the student? And when he or she thinks to attend even without knowing one single French word, then it's his or her own fault. (And it doesn't even matter if it is undergraduate or graduate school)

There are 4 spoken languages in Switzerland (mainly German, French and Italian) and all Swiss students can take an exchange semester at another Swiss university. Swiss universities don't require for example a French-speaking person to show German language proficiency, if he or she wants to attend a German-speaking university. They explicitly state that it's in a student's own responsibility to know German (in this case)
The short answer is that when people want something, they often experience cognitive distortions that prevents entirely accurate assessments. Dunning-Kruger is a good example of one of these effects, where a student thinks, "Oh, I'd love to study in Paris - and lots of people speak French, so I'm sure I could pick it up!" Learning a new language to a college-level of proficiency in reading, writing, and speaking is incredibly challenging, yet some people inevitably misjudge this.

Sure, the student would eventually figure this out and face the consequences, but in the mean time there are lots of reasons the institution wants no part in such a situation. For one, it's sad - a student will struggle, feel isolated, and most people end up blaming others for their situation and don't take complete responsibility ("why did they let me in if they knew it wouldn't work?!"), so it can be really unpleasant. I saw a student from China try to make it in English-only classes, and I couldn't make out if he even understood more than a few words in English - he only ever nodded, looked confused, and looked back down at his paper. It was just sad to see, and I can't imagine how this was helpful to him - the only way he could succeed was to have an interpreter (he didn't have one), or cheat, and that's just a terrible situation to be in.

Most institutions also have various statistics like drop-out and graduation rates, as compiled by an office like Institutional Research, often reported to the government (for "public" institutions, and others who take government money). Institutions have a lot to lose for regularly taking on students they have a very good reason to think will fail in their program, or will require disproportionately high resources to support. So they want to try to avoid such situations, when possible. Finally, positions in a class/program/institution are often limited, and accepting one student can mean necessarily rejecting some other student, which makes administrators even more keen to be careful of offering a spot to a student unlikely to succeed.