Bugger's Muddle

What is the origin of this. I use it to describe a situation which has reached a complex state of error ie many things have contrived to go wrong.

BUGGER'S MUDDLE -- "a bugger's muddle -- n. British. an absolute mess. A phrase which was in armed-service and middle-class use in the 1950s and although sounding dated, survives."

"bugger. vb. 1. to sodomize 2. to ruin, wreck, incapacitate, thwart. This figurative application of the term is several hundred years old."

From "The Dictionary of Contemporary Slang" by Tony Thorne (Pantheon Books, New York, 1990, originally published in London).

How can the British manage to sound high class even when they are talking dirty?