"Holy cow!" (and other similar terms), an exclamation of surprise used mostly in the United States, Canada, Australia, and England, is a minced oath or euphemism. The expression dates to at latest 1905. Its earliest known appearance was in a tongue-in-cheek letter to the editor: "A lover of the cow writes to this column to protest against a certain variety of Hindu oath having to do with the vain use of the name of the milk producer. There is the profane exclamations, 'holy cow!' and, 'By the stomach of the eternal cow!'" The phrase appears to have been adopted as a means to avoid using obscene or indecent language and may have been based on a general awareness of the holiness of cows in some religious traditions.
From the Dictionary of American Slang (1960):
"Holy Buckets!" Equiv. to "Holy cats!" or "Holy Mike!" both being euphemisms for "Holy Christ!". This term is considered to be very popular among teenagers, and most teens claim it is definitely a very popular phrase. It is also the common oath and popular exclamation put into the mouths of teenagers by many screenwriters, and is universally heard on radio, television, and in the movies. It was first popularized by the "Corliss Archer" series of short stories, television programs, and movies, which attempted to show the humorous, homey side of teenage life.
Expressions such as "Holy buckets!", "Holy underwear!", etc. also employ a play-on-words, "holy" implying "riddled with holes" [holey]. Paul Beale, however, revised Eric Partridge's A Dictionary of Catch Phrases and cites a different origin:
The original "Captain Marvel" and "Batman" oaths, "holy (something harmless)", were in turn spoofed in the later 20th century by whatever seemed relevant to the situation. Nigel Rees, in Very Interesting… But Stupid: Catchphrases from the World of Entertainment, 1980, instances "holy flypaper!", "holy cow!", "holy felony!", "holy geography!", "holy schizophrenia!", "holy haberdashery!", etc., and adds, "The prefix 'holy' to any exclamation was particularly the province of Batman and Robin, characters created by Bob Kane and featured in best-selling comic books for over thirty years before they were portrayed by Adam West and Burt Ward in the TV film series."
The phrase "Holy cow!" was used by baseball players at least as early as 1913 and probably much earlier. It became associated with several American baseball broadcasters. The phrase may have originated with reporter and broadcaster Halsey Hall who worked in Minneapolis, Minnesota from 1919 until his death in 1977. According to Paul Dickson, New Orleans radio announcer Jack Holiday also used the phrase on broadcasts of the minor-league New Orleans Pelicans in the 1930s. Harry Caray was the broadcaster for the St. Louis Cardinals (1945–1969), Oakland Athletics (1970), Chicago White Sox (1971–1981), and Chicago Cubs (1982–1997), and he began using it early in his career in order to prevent himself from lapsing into vulgarity. New York Yankees shortstop and announcer Phil Rizzuto was also well known for the phrase; when the Yankees honored him following his retirement, the ceremony included a real cow with a halo prop on its head. 1950s Milwaukee Braves broadcaster Earl Gillespie was also known for this expression.
The comic book series Common Grounds was based on the mini-comic Holey Crullers, named after its setting in a coffee and doughnut shop called Holey Crullers.