If the Shulchan Aruch primarily rules based on a majority based on the Rif, Rambam and the Rosh, who each (I'm assuming) are usually philosophically internally consistent, then wouldn't the Shulchan Aruch be philosophically internally inconsistent?
No. The philosophy is that majority rules; in that philosophy it is generally consistent.
You could ask the same question about any multi-member court or a legislature. Is it philosophically inconsistent because the majority which rules consists of different individuals each time there is a vote? No, because the philosophy that matters is not the philosophy of each individual, who is not himself the court or legislature anymore than the mailman or janitor is. The relevant philosophy is that of the court itself, which is nothing except the procedures that govern it.
Let us set up the following steps:
- The Shulchan Aruch always follows the majority of Rif, Rambam, and Rosh.
- Each of the three (Rif, Rambam, and Rosh) are philosophically consistent.
- If none of the three ever changed position on a philosophical matter, then the majority view on the philosophical matter can never have changed either.
- If the Shulchan Aruch always follows the majority and the majority can never change, ergo the Shulchan Aruch can never change.
Thus, assuming the premises to be true, it should be mathematically impossible for the Shulchan Aruch to be philosophically inconsistent. Any philosophical inconsistencies that do exist would have to be exceptions to one of the premises – either one of the three sources was inconsistent, or the Shulchan Aruch did not follow the majority in (at least one) of the cases.