There's also [this] (https://www.reddit.com/r/AskHistorians/comments/3iityp/ive_heard_that_one_of_the_popes_issued_a_ban_on/) older post, which talks about the (mostly unobserved) ban on ranged weapons by Pope Innocent II.
Commentary by /u/Domini_canes and /u/Valkine makes it sound to me the Pope's main concern was Christians killing each other rather than cowardice but there exists the possibility that a dishonorable peasant with only a few days' instruction in crossbow archery could have killed a chivalrous knight; perhaps they could chime in?
Snipers were often summarily executed in both WW1 and WW2. This is recognised to the extent that the US Army has taken the unusual step of putting a full section in its manuals stressing the fact that snipers are indeed covered under the laws of war, and should be treated as any other prisoner. See, for example, FM 3-06.11, para 6-5 "The Law of Land Warfare Applied to Snipers" http://www.bits.de/NRANEU/others/amd-us-archive/fm3-06.11(02).pdf Excerpt It is vital that commanders and leaders at all levels understand the law of land warfare and also understand the psychological pressures of urban warfare. It requires strong leadership and great moral strength to prevent soldiers from releasing their anger and frustration on captured snipers