Old Engish blodig, adjective from blod (see blood). Common Germanic, cf. Old Frisian blodich, Old Saxon blôdag, Dutch bloedig, Old High German bluotag, German blutig.
It has been a British intensive swear word since at least 1676. Weekley relates it to the purely intensive use of the cognate Dutch bloed, German Blut. But perhaps it ultimately is connected with bloods in the slang sense of "rowdy young aristocrats" (see blood (n.)) via expressions such as bloody drunk "as drunk as a blood."
Partridge reports that it was "respectable" before c.1750, and it was used by Fielding and Swift, but heavily tabooed c.1750-c.1920, perhaps from imagined association with menstruation; Johnson calls it "very vulgar," and OED writes of it, "now constantly in the mouths of the lowest classes, but by respectable people considered 'a horrid word', on par with obscene or profane language."
Shaw shocked theatergoers when he put it in the mouth of Eliza Doolittle in "Pygmalion" (1914), and for a time the word was known euphemistically as "the Shavian adjective." It was avoided in print as late as 1936. Bloody Sunday, Jan. 30, 1972, when 13 civilians were killed by British troops at protest in Londonderry, Northern Ireland.