The expression "holy cow" is similar in meaning to expressions like "holy mackerel" or "holy smoke" which means "Good Lord!" or "My God!", etc. Nothing to do with anything holy though.
"Holy" means devout, godly or virtuous. A holy person is someone who is devoted to the service of God (eg. a priest) or someone who lives a holy life and is pure in a moral and spiritual sense. We generally respect people with these qualities.
"Holy smoly" is a derogative term referring to people who are offensively sanctimonious or self-righteous, in other words, behaving in a "holier-than-thou" manner.