An historian could tell the tale more fully but back before Galileo and Newton there were no sciences to speak of. There was medicine of Galen from even further back. The practice of using Greek logic to solve mysteries of nature was not yet popular, at least in Europe.
The major form of scholarship there was of the Bible and histories. Anyone whose abilities were more intellectual than physical would tend to move in that direction. This would invite them to become theologians of some repute, or related professions, before their other interests in matters as novel as science started to be of some value. The Church kept intellectuals and intellectualism alive for centuries.
In earlier days European mathematics had crept along with much the same surroundings as Cardano could tell you.
I look forward to informative if scathing corrections.