I think you are confused because you are mixing two completely unrelated concepts.
The concept of "bad words" or vulgarities is a social concept, which varies greatly from region to region, and can often be influenced by local laws (i.e. certain English words cannot be said on broadcast television or radio in the US). This is true in any language.
The concept of positive or negative statements. This is a grammatical concept, and is also true in any language.
These concepts can be mixed together, and this seems to be where you're confused. It is possible to use "bad words" in the sense of #1, to make either positive or negative statements. Whether it's socially acceptable or not depends entirely on the social norms as mentioned in #1.
If it's socially unacceptable to say "mierda" in one context, then using the word "mierda" is unacceptable, regardless of whether it's making a positive or negative statement.
If it's socially acceptable to say "mierda", then it is also socially acceptable to say "mierda" regardless of whether it is making a positive or negative statement.
Let me provide some examples:
If you are in a family setting, where saying "Mierda!" would be considered offensive, then you should not say "Mucha mierda!" either... because "mierda" is offensive to those around you.
The same thing happens in English (or any other language).
If it is inappropriate to say "fuck" in front of your mother, then when she asks if you want dessert, you won't respond by saying "Fuck yeah!"
"Fuck yeah" is obviously a "positive" statement, but you won't use that word in that context, because the positive or negative nature of the statement is completely irrelevant to the appropriateness of that vocabulary in that context.