This essentially happened to me last year as well. I was rejected to practically every school I applied to. UCLA, UCB, and I even thought CSULB might be a more realistic school for me, but they rejected me as well. I was offered a Regents scholarship to UCLA (not for UCSD), so I did indeed have a 4.0 since it seems like UCLA only ever offers those to students with a perfect GPA. I did get a spring grade request from USC as I was still completing my necessary math, but I would up with a B, my GPA dropped to 3.93, and I was rejected.
I applied to the same schools again this year and I’ve had better luck despite having a worse GPA and overall not taking on as many “challenging” classes as I did last year. I got into UCLA and still have my fingers crossed for USC.
Anyway, it would certainly seem like everyone that has a perfect GPA gets accepted, but it doesn’t always happen that way.