Now, I don't exactly get this specific question a lot, but I definitely have to explain to people more often than not that growling is NOT a bad behavior and should not be punished. Growling is a form of communication. We would never punish a child (at least I hope not) for telling us they do not like something or someone. In most, if not all cases, punishment leads to worsening the underlying problem. Now, don't get me wrong, growling is not necessarily a wanted behavior by our human standards, and I wouldn't recommend encouraging it - at least for a pet or companion dog. And if you've ever punished your dog for it, I totally understand - you want it to stop. But growling is an indication of the dogs perception of a situation. They're literally telling you something. So, to understand how it isn't bad, let's talk about growling.
Dog's will growl for many reasons. Sometimes, it's just a by-product of the situation, like during play with another dog or a tug-of-war game. Sometimes, it's a reflection of a deeper issue - to create space from people or dogs they don't know or trust, or to warn people or other dogs to stay away from an item they value. They may also growl to indicate an attempt at an act of aggression. Let's break down these scenarios and discuss.
Growling during play with another dog - This is totally normal and should not be punished. Imagine two high school kids wrestling around; there's going to be a lot of grunting and noise coming from them. The same goes for dogs. It does not mean that supervision isn't mandatory when dogs play or that things can't get out of hand and possibly need interrupting. What it means is that it's usually not a problem. I have a very vocal dog and he growls whenever he plays. This is very normal, and I expect it and understand it. If you are inexperienced or uncomfortable with it, you can always not allow your dog to play with other dogs. You have that right as their owner. Regardless, I always recommend supervised play and getting to know your dog well to understand better what is typical, acceptable, and appropriate for your dog.
Growling during a tug-of-war game with you - This is also normal and should not be punished. Growling at this time is part of the game. Have you ever made a grunting noise while lifting something heavy? Well, this is a lot like that for your dog. Usually, the more they get into it and tug, the more they growl. Now you may have heard somewhere that you shouldn't play tug with your dog because it encourages aggression. I could not disagree more. However, if you do not have a good relationship with your dog or they tend to guard their toys, I'd address that first and avoid playing tug in the meantime.
Growling at people or dogs to create space - While this is normal because it happens frequently and many people deal with this from their dogs, it represents an underlying issue that needs to be addressed asap. It is not "bad" behavior, though. Dogs that growl to create space are typically afraid or uncertain, and growling here should be seen as a warning. Poor socialization, a bad experience, or punishment for expressing themselves (growling/barking) are usually the leading causes for timidity and distrust. If your dog is growling because they're uncertain or afraid and want someone/a dog to go away, your first thought should be, "how can I change the way they feel about that person/dog?" But, most people's first thought is, "this needs to stop right now," and they react by yelling at and or punishing their dog. Please don't do this. Don't make that mistake because what you're doing creates a more negative experience for your dog that becomes associated with people or other dogs. Taking this action is guaranteed to make the behavior worse. It always does. Let's look at it from your dog's perspective; they're afraid of people coming into your house or people approaching on a walk and growl/bark to make them go away (because they're nervous or fearful). You yell at them and maybe throw in a smack on the butt or a yank of the leash. Overall, how do you think your dog feels about people coming over or walking by? Not good. It would be equivalent to punishing a child who is afraid of the dark when the lights go out. You would only make that child more stressed and anxious when the lights go out.
A better and more effective way to resolve the issue of growling with a fearful or timid dog when someone comes over is to change the motivation. We know that the dog is motivated to create space by growling, so how about only feeding the dog when someone comes over? We could even step up a notch by having the guest feed the dog. Now we have a hungry dog that is more accepting of people because people represent something they want. Food. (please do not take this as official training advice - there is more to behavior modification and the psychology of a fearful dog than this)
Growling to keep others away from an item they view as valuable - This is concerning and should be addressed asap. Keep in mind though, that the growling is a warning system, and while it is not preferred, it is not "bad". The alternative is going straight to biting without warning - that's bad. The method by which you resolve this issue is up for debate amongst trainers, but my recommendation is to show the dog that there is no reason to keep me away from their item. I want to show the dog that when I walk towards them as they are in possession of the item, I only come to add value to what they already have. Again, this is changing the way the dog feels about my approach. If the dog is punished, they may think that they should escalate their aggression to convince me to stay away. (please do not mistake this as training advice. There is a lot more to behavior modification).
Growling that always precedes an act of aggression - Even here, growling is a heads up that you or someone is about to get bit. Definitely not good, but at least you've been given a second or two to protect yourself or move out of the way. The more significant issue is the fact that this type of dog thinks it's okay to act aggressively. If a dog has a history of biting and actively tries to attack people or dogs, growling isn't the issue, by a long shot.
Growling is a form of communication, plain and simple. It is never "bad" in and of itself. The actions that follow might be bad, but the real question is "WHY?" whenever a dog is growling. In my experience, most dogs are not forward aggressive (meaning they're not looking for a fight); most dogs that growl are really trying to create space. You must figure out why your dog is growling in the first place and start there. Is it meaningless like during innocent play? Or is it a warning of a potential attack? It's up to you to figure that out. I would recommend hiring a professional for help ASAP if you cannot determine the root cause of the problem. But, in the meantime, do not punish growling.