I was at the sea and thinking again about Rav Shach's explanation of the argument between the sages and R Shimon in laws of Sota chapter 1 halacha 3. And based on that explanation he explains the Rambam. At first I was thinking that it seems that according to Rav Shach that the Rambam was posek like R Shimon against the sages, [and that would be a problem if it were the case.] And then it occurred to me that in fact his explanation of the Rambam works perfectly.
Perhaps I should give a bit of background so what Rav Shach is saying will become clear.
The statement of the sages is a mikve that upon it pure things were prepared. [food was prepared by someone who at first was a nida or anyone who was impure and went to a mikve. ] Then the mikve was found to be lacking the proper volume. All the pure things are unclean whether in a private or public domain.
The gemara asks from a barrel that is found to be sour. The wine turned to vinegar. This barrel was used for separating tithes. For the last three day all the tithes are considered invalid. Before these three days all the tithes are in doubt.
The first explanation of the Gemara is that the mikve is the sages and the barrel is R Shimon. R shimon would say the mikve is pure in public domain and a doubt in a private domain.
Then the second explanation is that R Shimon says we learn from the beginning of uncleanliness to the end. Just like at the beginning if one is in doubt if he touched then he is clean. So also if there is a doubt if one went to the mikve or not they are clean. The sages say we do not learn from the end to the beginning.
Rav Shach says the issue is about two hazakot. Hezkat hashta and hezkat tuma against hazaka meikara. Rav Shach says that in this second explanation of the gemara, the gemara is thinking that this case of two hazakot results in a doubt. [This is not like the first way of the gemara that holds two hazakot against one is a sure thing.]
Thus R Shimon is clear about the barrel. that is what he says that it is a doubt. The barrel we know is now vinegar and the tevel starts out as being tevel until we know its status changed. That is two hazakot against one that the barrel used to be wine so it has a hazaka meikara.
But R Shimon would not hold this way by the mikve since there is a general principle that concerning purity and impurity we learn from sota. So he learns straight from sota. The food prepared by people that went to that mikve and that mikve is the public domain. So that food is pure. If the mikve was in a private domain the food is in doubt.
But the sages do not learn from sota. and the gemara is giving the explanation of why. That is we do not learn from the start of impurity to the end. Since we do not learn from sota we puts things into the regular category of two hazakot against one.
So now we understand that when the sages says the food is impure that means it is in a state of doubtful purity. And that is exactly like the case of teh barrel. and that is how the Rambam can posek like the statement of the sages about the mikve and the statement about the barrel. He is not going like R Shimon. Rather by the barrel there is no argument. al agree it is a doubt because of two hazakot. The argument is the mikve and R Shimon would agree with the sages if we would apply the principles of two hazakot here. But he does not. He applies the law of the sota. The public domain in pure and private is a doubt.