Often people swear to indicate that they don't want any discussion on the topic, basically to shut other people around them up and demonstrate that they are not open-minded about the issue at hand. A hostile swearing remark will cause others to back down in conversation. This can be used sort of as a warning device.