From the experience of someone who has worked in both K-12 and higher education, the problem is innate to the competitive access to higher education and the roots are way deeper than 4-year research universities.
Elementary Schools (grades K-6)
Elementary schools have not been well known for their grade inflation. They are held to stronger minimum student competency standards that allow them to get away with giving a kid an "N" (needs improvement, aka: Fail).
Middle School (grades 7-8)
Grade inflation starts in middle schools where educators understand that proper placement into advanced high school courses poise students for better quality education (regardless of work completed).
High School (grades 9-12)
High School grade inflation most often occurs in advanced classes, to facilitate increased chances of being accepted into a well-respected 4-year university. This problem is exacerbated by helicopter parents and administrators/teachers that don't want to deal with them.
Community College
Grade inflation here is rare unless you're one of the very few students who are actually making the effort to transfer to a 4-year university. These students get "known" personally by instructors and under-staffed counseling centers and relationships are built, exceptions begin to be made/justified, etc.. I've helped to navigate student through CC specifically by connecting them to the right people to make sure they make the transfer in 2-3 years.
Undergraduate (4-year University)
Grade inflation here exists in part because faculty and lectures want students to "have every opportunity possible" to go to grad school (much like what happens in high school), but also because lecturers (without security of employment) that get bad reviews (grade rage) are less likely to be invited back to teach again. This problem is exacerbated by helicopter parents and administrators/teachers that don't want to deal with them.
And all of this exists because we make access to quality education a competition! There would not be grade inflation in middle school if every regular high school teacher was as effective and driven as those who teach high school advanced placement courses. There wouldn't be grade inflation if public universities put less weight into GPA and more into impromptu writing (submitted writing is too biased) and proctored exams. (Instead, GPA should only be for the valedictorian prize and as a progress report on the effort made towards one's education as exhibited by assignment submissions.)
Thus, there wouldn't be grade inflation if we made access to higher education an expected right given that minimum qualifications are made.
"But college education is so expensive! We can't educate everyone to the same caliber with what we have!"
I call BS. At a luxury- and notoriety-based research university, undergraduate education is expensive. At non-research universities, education is relatively cheap. Solution: Make the very specific and public differentiation between "College" and the "Research University". Want a good education with the potential to access research-based careers? Consider attending a Research University. Want a good education so that you'll be a better person, member of society, and have a head start in a chosen industry? Consider going to College.
In California, it's the difference between attending one of the California State University campuses and attending one of the University of California campuses. We need more Cal States and we need to utilize GPA less.