I'm about to submit the final grades for my freshman biology course, which prompts some thinking about why we give grades (rather than e.g. pass/no credit).
A "pass/no credit" system accomplishes one of the functions of grading. It filters out the students who are not prepared to proceed to the next stage in their education program (or their like). When students complain (beg for special consideration), I often argue that "I've given you an 'F' for your own good", and I encourage them to think about other career plans than medical school (or Pharmacy, which is big here).
But when I fail students in their first year of university I'm also motivated by the benefits to other members of the university community. That's the filtering function - part of my responsibility is to prevent unprepared students from going on to more advanced courses. Such students are a tremendous drag on teaching; both the instructor and the other students pay a heavy price if the level of instruction has to be lowered to accommodate students who should never have been allowed to enroll.
The other functions of grading won't be satisfied by a "pass/no credit" system. One of these is ranking the students who have passed. Our university uses student grades to assign priority in registering for next year's courses. So students with good grades have first choice of the often-limited places in the courses they want, and students who have just scraped through have to put up with what's still available when are finally allowed to register.
Another function of grading is giving the best students the marks that get them scholarships and other benefits. It's not enough that a student is top of the class - if the top mark is only a B this student won't make the local equivalent of the Dean's List. With a class of 400 (well, two classes of 200), I want to give the top ten or so students A+s, even though my tough final might have left them with what would otherwise be an A-.
One final issue is consistency of grading in a big course with sections taught by different instructors. The different instructors may have to compromise our individual grading philosophies a bit to ensure that students in different sections are treated comparably. So I'm waiting for the course coordinator to give me the OK to click the "submit grades" button.