Cops have evolved into tax collectors with a gun. Municipalities are broke and now they're relying on their "law enforcement" to provide supplemental income. It's been going on for at least 10+ years now. Fighting actual crime COSTS money. Writing tickets for menial offenses drives revenue. It's not necessarily the cops' fault as they're being pressured to do it by the politicians.
That's how CA is balancing the budget :-) Best way is to steer clear. Those tickets are not cheap either