Many prominent mathematicians like Barrow, Cavalieri, Wallis, Moigno, Bolzano, Bayes, Venn, Gerdil were clergymen. Are there investigations in the social sciences about the percentage of clergymen in mathematics compared to the percentage of clergymen in the population? I expect an overproportionate share because of the high intellectual level of clergyman compared to the general population.
The answer depends of the period, of course. I do not think you will find many clergymen among mathematicians in 20th century, or even in the 19th century. The reason is simple: most mathematicians need some income for living. So what jobs were available to mathematicians in various periods?
Since 18th century they mostly take positions at the universities. Until 17th centuries, most universities were essentially religious institutions, their most important function was preparation of clergymen, and many professors were clergymen. If one did not stay with a university, becoming a priest was a good alternative, and usually brought a good income.
There were alternatives of course: many mathematicians until 17th century practiced medicine or astrology. I think these three professions were most popular among mathematicians until 17th century: clergyman, medical doctor or astrologer. Except those who had independent means and did not need additional income. But this was always a small minority.
By the way, Newton was pressed to become a clergyman: this was a condition for his position in Cambridge. Only with great efforts he obtained an exemption (this had to be granted by the king!) And the reason was that Newton had beliefs which strongly differed from mainstream Anglican dogma (he was a secret Arian: did not believe in the Trinity).