Or the yellow is too short for the posted speed.
The minimum length of a yellow must allow enough time to realize it has turned yellow plus enough time to either safely come to a stop or continue through the intersection at normal speed plus enough time to allow for human mis-calculations. If it is any shorter than that (or if other yellow lights in the area are too short) you will get people gunning it or panic stopping. Shorter still and you'll have people running the red. Force people to run the red often enough and they'll decide one more won't hurt and they'll start 'accidentally on purpose' running the red
Making the penalty for running a red too high can also result in people gunning it or panic stopping to make SURE they don't run the red. That cost can be in liklihood of an accident (from not having all red) or the cost in points (and so insurance rates) or the fine itself.
Of course, if the yellow is TOO long (I've never sen that in practice), people will ignore it. A brief all reds state can add extra safety without having a too long yellow.
When writing tickets and traffic court are cost centers, you will tend to see the yellow time set to maximize safety. If those are a profit center (or if they reduce the cost of cameras to the local government), you'll tend to see reduced safety.