I am sure the monkey in trouble triggered the predatory instinct in the bear. Wounded prey is the easiest to attack.
Animals have a strong instinct to attack any nearby injured animal and finish it off, and hunger seems to have nothing to do with it. This behavior may be an instinctual way of attempting prevention of the spread of disease.
I’ve seen this behavior many times. Birds are very prone to attack a suddenly injured member of their group. Even domestic animals will sometimes display this type of aggression.
The bear was just being a bear.