According to TV critic Charlie Brooker in his glowing review on his BBC programme Screenwipe (clip, ~9m50s):
Actually the constant bad language is a deliberate stylistic choice. People in the wild west didn't really speak like that, they used cusswords like nincompoop or tarnation, which would have been shocking at the time but strike us today as impossibly tame.
But the creators decided to make the townsfolk contemporarily foul-mouthed to maintain that anarchic, underclassy feel in the present day. And it works. The people of Deadwood talk f---ing tough.
From its debut, Deadwood has drawn attention for its extensive profanity. It is a deliberate anachronism on the part of the creator with a twofold intent. Milch has explained in several interviews that the characters were originally intended to use period slang and swear words. Such words, however, were based heavily on the era's deep religious roots and tended to be more blasphemous than scatological. Instead of being shockingly crude (in keeping with the tone of a frontier mining camp), the results sounded downright comical. As one commentator put it "… if you put words like 'goldarn' into the mouths of the characters on 'Deadwood', they'd all wind up sounding like Yosemite Sam."
Instead, it was decided that the show would use current profanity in order for the words to have the same impact on modern audiences as the blasphemous ones did back in the 1870s. In fact, in early episodes, the character of Mr. Wu seems to know only three words of English — the mangled name of one character ("Swedgin"), "San Francisco", and his favorite derogatory term for those whom he dislikes, "cocksucka". Wu is fond of the Cantonese derogatory term "gweilo" which he applies to the camp's white males.
The other intent in regards to the frequency of the swearing was to signal to the audience the lawlessness of the camp in much the same way that the original inhabitants used it to show that they were living outside the bounds of "civil society".
The issue of the authenticity of Deadwood's dialogue has even been alluded to in the show itself. Early in the second season, E.B. Farnum has fleeced Mr. Wolcott of $9,900, and Farnum tries to console the geologist:
EB: Some ancient Italian maxim fits our situation, whose particulars escape me.
Wolcott: Is the gist that I'm shit outta luck?
EB: Did they speak that way then?
The word "fuck" was said 43 times in the first hour of the show. It has been reported that the series had a total count of 2,980 "fucks" and an average of 1.56 utterances of "fuck" per minute of footage.