Since writers strive to impart knowledge, it's tempting for us to insert ourselves into the narrative and make sure people know how much we know. It gratifies the ego and, we hope, impresses others.
That's why those two little words "of course" make their way into places where they don't belong, sometimes creating an impression that is the opposite of what the writer intended.
Of course, no one who assessed the damage was certified.
Of course the candidate had no hope of winning.
The ad campaign was authorized, of course, by the chief executive.
There are two possibilities when the obviousness of a situation is underscored in this way: Either the facts are self-evident to the reader, or they are not. If the former is true, and the statement is something everyone already knows, there's no need to draw attention to it with "of course." If the facts are not self-evident, "of course" doesn't belong, because the writer knows that the statement will likely be unknown to whoever hears it. In either case, the addition is needless.
The further problem with "of course" is that it often sounds like a way of talking down to the reader. It says either "Everybody knows this, but I'm telling it to you anyway because you wouldn't have thought of it" or "You don't know this, but it's obvious to me." It also interrupts the thought the writer wanted to convey by prompting the reader to wonder whether the statement is or isn't common knowledge, or whether the writer is simply taking a pompous tone.
Sometimes we can get away with sneaking in "of course." When it draws attention to an ironic twist, it can even be welcome.
She told her husband to stay home that night, but of course he didn't.
Of course the dead constituents didn't show up at the ballot box, but that didn't stop Smith from claiming their votes.
It can also be used as a rhetorical device to group people together who are presumed to share a common strain of thought.
Of course you all know why I brought you here.
We at the institute are all dedicated to the cause of economic freedom, of course.
So whether to use "of course" or not is a matter for the writer's own discretion. But we should be wary of using it in situations that don't warrant it or where it is unnecessary and intrusive. We shouldn't resort to "of course" as a matter of course.