The expression "have a cow" is said to have originated in the 1950s, although an earlier British expression, "having kittens," did cover the same territory. The idea is that certain bits of unexpected or bad news might create the same agony and pain as literally giving birth to a cow. There is every chance that the recipient of bad news might react badly, going ballistic or blowing his or her top.
The cartoon character Bart Simpson helped to popularize this expression with one of his catchphrases, "Don't have a cow, man." Since the character was known for his outrageous pranks and irreverent attitude toward authority figures, most of his victims were prone to extreme frustration. In some respects, it may be more understandable to have a cow instead of a hissy fit, since even the most patient person could lose his or her temper with the proper outside motivation.
Sometimes the expression is used in anticipation of an emotional response. One might say the boss will have a cow when he learns what the new employee did to the company car. A parent might have such a reaction if a child fails to meet an assigned curfew. The problem is not always the bad news itself, but rather the level of anger or outrage the recipient is about to reach. This is why many people try to defuse the situation by advising the recipient of stressful news to not react badly.
The expression is very informal, so it shouldn't be used in situations where serious empathy or counseling would be in order. The advice to "not" have one might best be used in circumstances where the initial situation sounds worse than it actually is. When a child brings home a bad report card, for instance, a parent might react badly at first, but the long-term problem can still be addressed. There may be no good way to avoid watching someone have an extreme response to an issue, but the good news is that the episode is usually short-lived.