So far as I know, it’s only the Roman Catholic Church that requires priests to be celibate. I think Anglican and Episcopal priests are free to marry and have children.
I’m not sure when the rule came into being for Catholic priests to be celibate, but it did not always exist. It is also common knowledge that in medieval times some Catholic clergymen had mistresses and a lot of children with them. Though everyone knew about it, the mistress and her children lived in a separate house from the priest who consorted with the woman and fathered her children.
Do the rules keep today’s Catholic priests celibate? Who knows? With easy access to birth control and contraceptives the secrets are easier to keep between consenting adults. It is the violation of children at the hands of trusted church leaders that concerns us now-a-days.