This article is from the alt.usage.english FAQ, by Mark Israel firstname.lastname@example.org with numerous contributions by others.
The use of "bloody" as an intensifier used to be considered
highly offensive in England, as the fuss made over it in Shaw's
"Pygmalion" shows. (It is less offensive now, as shown by its
use on mainstream British TV programmes such as EastEnders.)
Eric Partridge, in "Words, Words, Words" (Methuen, 1933), lists
the following suggested origins:
1. From an alleged Irish word "bloidhe", meaning "rather". This
was proposed by Charles Mackay in the 19th century, but is highly
implausible: even if the word exists, it would presumably have
been pronounced /bli:/ since the early Modern Irish period. The
closest I could find to it in an Irish dictionary was "bluire"=
"a bit, some".
2. "by our Lady" (an invocation of the Virgin Mary). There *was*
an interjection "byrlady", attested since 1570 and frequently
used by Shakespeare, which *did* mean "by our Lady". But
this was an interjection, not an adverb, although a citation
from Jonathan Swift ("it grows by'r Lady cold") shows a possible
intermediate use. The transition from "byrlady" to "bloody" is
3. "S'blood", an ancient oath shortened from "God's blood". The
Oxford Dictionary of English Etymology says this is "probably"
the origin, but the OED says "there is no ground for the notion".
The etymologies in the OED are largely untouched since the first
edition; the ODEE is generally more up to date.
4. blood with reference either to menstruation or to "the bloody
flux", an old term for dysentery. "Ingenious, but [...] much too
restricted", says Partridge.
5. "blood", an aristocratic young roisterer. The OED plumped for
this one, because its earliest citations of "bloody" as an
intensifier were in the phrase "bloody drunk", which it
conjectured meant "as drunk as a blood" (cf. "as drunk as a
lord"). But the earlier citation found by Weekley (see below)
makes this less plausible, and "bloody drunk" would be an
unusual lexicalization of "as drunk as a blood".
6. blood's being something vivid or distressing. Partridge himself
plumps for this one.
Ernest Weekley, in "Words Ancient and Modern" (Murray, 1926),
finds analogous uses of French "sanglant", German "blutig", and
Dutch "bloedig". He gives one citation that antedates those in the
OED ("A man cruelly eloquent and bluddily learned", John Marston,
1606 -- but "bluddily" may be a descriptive adverb rather than an
intensifier here), and two ("It was bloody hot walking to-day",
Swift, 1711; "bloody passionate", Samuel Richardson, 1742) that show
that "up to about 1750 it was inoffensive". He attributes the
dropping of "-ly" from "bloodily" to "an instinct which tends to
drop "-ly" from a word already ending in "-y"", as seen in "very",
"pretty", and "jolly".
A Merriam-Webster etymologist (in e-mail to me) chose 6, possibly
influenced by 3, considering the analogy of German "blutig" the
strongest argument, and added: "'Bloody' in 19th-century England --
like 'fucking' and other so-called intensifiers -- functioned
principally as a marker of speech register signaling group or class
membership. In a society in which speech register was strongly
associated with economic class, and class distinctions were
extraordinarily significant, it is not too hard to see why 'bloody'
became so taboo for Victorians. I'm not sure any other explanation
need be sought. The taboo on 'bloody' as well as a lot of other
constraints in Britain declined in force with the social upheavals
initiated by World War I."