Religious affiliations are rarely just a matter of faith. There can be myriad reasons why a self-proclaimed secular government nevertheless maintains religious convictions or practices. Sometimes it is a matter of political expedience: if a majority of subjects have a particular religious affiliation, it may make sense to share that affiliation. Alternatively, if one's geopolitical allies align themselves with Catholicism as their rallying point (over against Protestantism), then doing so yourself may provide enhanced diplomatic standing. Essentially, then, to answer your question you need to dig deeper: what were the benefits of maintaining allegiance to Catholicism for these ruling families? What forces—political, economic, cultural, etc.—may have impacted their allegiance? What philosophical, cultural, or religious developments occurred that may have created a justification for upholding secularism on the one hand and Catholicism on the other? Perhaps that you find for some that personal conviction was a motivation, but even for those it will rarely (if ever) be the sole driver.