They tied a rope around the high priest's foot before he entered the holy of holies in the event he wasn't righteous enough and died, so that they wouldn't die when they went in there to get him, they would just pull him out with a rope. But, I can't think of a case where someone was killed for jacking off in a church so you may be right.