I'm not sure that those lines of study were actually considered separate at the time. A century earlier than Newton's time, math and geometry were considered subfields of astronomy; and astronomy was considered the observation of the realm of the divine. Not only was there not a divide between physics and theology, people actually thought that math was a tool for studying theology (one of Copernicus' sources of incom…
For a modern viewpoint it might seem like Newton was "hedging his bets" by contributing to several totally different fields, but I don't think it was seen like that at the time. It was all "philosophy".
Other "philosophers" in the early modern period had similar interests. For example Tycho Brahe is remembered as an astronomer with a strong focus on empirical observation, but actually was just as focused on astrology, alchemy and medicine (which was connected to alchemy and astronomy because of the same philosophy).
Newton was a "renaissance man".