College/University degrees allow students to do things they might not be able to do without the degree. Course credits can lead to degrees. They want the degree (and sometimes just certain courses) and the degree + transcript is a kind of certification by the college/institution saying that this person did the following things sucessfully, have the following skills, are good at X, Y and Z and so on.
This gives the person the opportunity to seek further education that requires these prerequisite skills and knowledge and also affects employers when they try to find the right people to employ. Students who have not actually learned from the course are committing a kind of fraud. They are then misrepresenting themselves not just to the teacher/professor but to future employers and other institutions.
They may have absolutely no interest in the subject.
Note: there are many things to criticize about many facets of society involved in these processes. But none of these offer a good defense of pretending to have learned something one has not.