The title has to be “radio-friendly”.¹ Potentially offensive words shall be censored in the titles, but can be explicit in the bodies and comments.²
The rule applies to every site on the Stack Exchange network, regardless of whether the question is currently a hot network question. It can be found expressed in various ways as part of answers and comments on various SE meta sites, as in the examples quoted above. I hope that it will someday be added to the Help Center to make it easier to point to, but there is no question about it being an official rule.
At issue is that offensive language in question titles can cause Stack Exchange to be blocked by content gateways such as corporate proxies. Stack Exchange views this as a business concern. The Stack Exchange network is only useful and self-sustaining when everyone is able to visit it.
“Radio-friendly” refers to Federal Communications Commission rules that prohibit obscene, indecent, and profane broadcasts.³ The assumption is that content gateway filters will probably not be triggered by question titles that would be acceptable on air.
If necessary, titles containing offensive language can be “bleeped” with asterisks or hyphens, but the preferred solution is to rewrite to avoid “bleeping”. To cite a past example,⁴ “Differences between slang words for breasts” is preferred over “Differences between ‘t*ts’ and ‘b**bs’”.
The word shit is avoided on air, consistent with FCC rules. In this case, the decision to edit the question title is the right one.