Pretty much every branch of Christianity did until very recently. Martin Luther railed against it.
And a hundred years ago, so did a lot of doctors who were convinced that it make you go blind or insane. Let's face it, all masturbation does is make you postpone the need to get a spouse, to start having kids with. That's why religion was against it, or anything that did not help increase the flock.
Martin Luther railed against masturbation? What a hard-a$$!