These are a lot of assumptions to make about this student from one post (or a few posts). He has a 3.5 UC GPA - that’s actually decent. A 3.1 unweighted GPA is not bad, although in these days of hyper inflated high school GPAs it looks that way. It’s decent - average.
Most CC students don’t transfer to four-year colleges for many of the same reasons they end up at CCs in the first place - poverty, family responsibilities, work schedules, and poor high school education. That 23% number also includes the students who never intended to transfer to a four-year college, either because they are only taking a few classes or because they only wanted an AA to begin with. An academically solid middle-class student with family support would have more than zero chance of transferring to a four-year college from an CC. In fact, because six of the UCs have a transfer admission guarantee, I would wager that his chances are pretty good. (Now chances of transferring into Berkeley CS? Not good at all.)
There are all kinds of students at community colleges. There are procrastinators and layabouts but there are also dedicated, hard-working students who ended up at CCs because of family finances or a desire to stay at home and save money. I also might add that four-year colleges have their share of procrastinators and layabouts, too.