Neither of the meanings suggested in the question is quite right. The first (“something great was achieved, so a sacrifice was made”) probably isn't relevant. The second (“a particular action is bad and should be avoided”) is relevant, but wrong. The idea of the joke at the wikipedia link (“Every time you masturbate… God kills a kitten”) is to make fun of the notion that masturbation is so bad that it has grave consequences, in this case dismaying God so much that he or she goes and kills a kitten. In other words, the joke is not intended to imply that masturbation is bad; it's intended to ridicule the traditional perception of it as seriously bad.
The schneierfacts.com item (“Every time Bruce Schneier writes a fully general halt-checker, God kills a passenger pigeon. This is why passenger pigeons are extinct”) on the other hand is not a joke, but merely a humor-free attempt at one. That, or it is an in-joke understandable by some small clique. Anyhow, it's easy to prove there is no such thing as a fully general halt-checker, so obviously the writing of one has never resulted in God killing a passenger pigeon, hence Bruce Schneier writing a fully general halt-checker can have nothing to do with why passenger pigeons are extinct.