When speaking with colleagues, it's discouraged only when there's people who are trigger-happy about complaining to HR. Fairly or not, women in particular have a reputation of running to HR when someone says something offensive or crude, which leads to them being excluded from office banter, which leads to them feeling left out of the group. Tough problem to solve.
It makes sense really. You let the profanity flow when you feel that you can trust people. You're also most honest when you feel that you can trust people.